Skip to content

Instantly share code, notes, and snippets.

@deanoakley
Last active December 4, 2023 05:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deanoakley/77cad07f3afea4ab96fa6c1ea7c865d1 to your computer and use it in GitHub Desktop.
Save deanoakley/77cad07f3afea4ab96fa6c1ea7c865d1 to your computer and use it in GitHub Desktop.
wp cli - update all the things
# Update WordPress and enable auto updates
# Install and activate the Akismet plugin
wp plugin install akismet --activate
# Deactivate the 'disable-wordpress-updates' plugin
wp plugin deactivate disable-wordpress-updates
# Update all plugins
wp plugin update --all
# Update the WordPress core
wp core update
# Enable automatic updates for WordPress core
wp config set WP_AUTO_UPDATE_CORE true --raw
# Update all plugins again (useful if a core update affects plugin updates)
wp plugin update --all
# Enable auto-updates for all plugins
wp plugin auto-updates enable --all
# Update WooCommerce database, if WooCommerce is installed
wp wc update
# Update the WordPress database (useful after a core update)
wp core update-db
# Delete all inactive themes
wp theme list --status=inactive --field=name | xargs -I % wp theme delete %
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment