Note:
You can also find the plugin or theme slug by going to your WordPress files and typing in:
wp plugin list
wp theme list
Rollback a Plugin to a Previous Version
If you need to test that the command is correct, you can always use the flag –dry-run at the end of the command:wp plugin update contact-form-7 --version=5.0.5 --dry-run
In the following example, to rollback Contact Form 7, you can use this command:
wp plugin update contact-form-7 --version=5.0.5
Activate A Particular Version of a Plugin
If you need to install and activate a previous version of a plugin, run:wp plugin install contact-form-7 --version=5.0.5 --activate --force
Update All Plugins
If the plugins you updated have been fixed and you now need to update all plugins, the example command is:wp plugin update --all
Excluding A Plugin
If you want to update all plugins, but need to exclude a specific plugin (in this case WooCommerce), run command:
wp plugin update --all --exclude=woocommerce
Rollback a Theme to a Previous Version
If you did need to rollback a parent theme to a previous version, you could use this command example which would rollback the Storefront theme to version 2.4.0:wp theme update storefront --version=2.4.0
Update Theme to Current Version Release
If you know wanted to update the Storefront theme on a site to the most current version, you could use this command example;wp theme update storefront
Using a mix of these WP-CLI commands will enable you to easily rollback a plugin on your site, rollback a theme, or update all plugins. It will also update all plugins, but exclude a specific plugin from being updated. Our Managed WordPress product comes with WP-CLI installed along with easy, automatic updates. Check out how our Managed WordPress platform can streamline your work today!