WP-CLI » Reinstall all WordPress plugins using WP-CLI

Reinstall all WordPress plugins using WP-CLI

Here is a convenient WP-CLI command that I use when cleaning hacked WordPress websites in order to reinstall all plugins from WordPress.org

It consists of two commands: get a list of all active plugins, then force reinstall for each plugin.

wp plugin install $(wp plugin list --field=name) --force
image 82 1024x439 - Reinstall all WordPress plugins using WP-CLI
wp-cli reinstall all plugins

To reinstall all WordPress themes in the same manner use:

wp theme install $(wp theme list --field=name) --force

Was this post helpful?

Leave a Comment

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.

Recommended