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
To reinstall all WordPress themes in the same manner use:
wp theme install $(wp theme list --field=name) --force
Was this post helpful?
Let me know if you liked the post. That’s the only way I can improve. 🙂