brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: wp plugin auto-updates enable turns on WordPress auto-updates per plugin

WordPress
~/tips/tip-wordpress-wp-plugin-auto-updates

wp plugin auto-updates status --all

Switches WordPress plugin auto-updates on or off from the command line, per plugin or all.

Turning on auto-updates for plugins means clicking a link per plugin in the admin. With WP-CLI it is one line, and you can see the state of all of them at once.

wp plugin auto-updates status --all

That shows every plugin and whether auto-updates are on. Turn them on for a few plugins, or for all:

wp plugin auto-updates enable akismet hello
wp plugin auto-updates enable --all

And off again with disable. For a script, the status command can give you only names:

wp plugin auto-updates status --all --enabled-only --field=name

Other output formats are csv, json, yaml and count.

My approach on a small site: auto-updates on for the boring, well-maintained plugins, and off for the big ones that change a lot at once, such as a page builder or a shop plugin. Those I’d update by hand after a backup.

Caveats. The command arrived in WP-CLI 2.5.0, so an old WP-CLI does not have it; wp cli version tells you. Auto-updates also need WordPress to be able to write its own files. And turning them on is not a backup plan. If an update breaks the site at night, you find out in the morning.

Further reading: WP-CLI: wp plugin auto-updates

More WordPress tips wp user application-password create anna backup-script --porcelain define( 'MEDIA_TRASH', true ); wp cli check-update wp theme delete --all wp media image-size All WordPress tips (85) All topics

Link