Force re-downloading plugins and themes with WP-CLI

Home » Notes » Force re-downloading plugins and themes with WP-CLI

Recently I found myself needing to force download all plugins and themes in a WordPress installation. Now, the old way would be to download them, upload them via SFTP. Very laborious, no fun.

Enter the fun way: WP-CLI. If you’re unfamiliar with WP-CLI, it’s the command line tool for WordPress. And as all sites on Servebolt have the wp command available, this was super easy to do with just two commands:

Force download all plugins:

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

Force download all themes:

wp theme install $(wp theme list --field=name) --force
First name
This field is for validation purposes and should be left unchanged.

Automatically sent to your inbox 🪄 

11 responses to “Force re-downloading plugins and themes with WP-CLI”

  1. Force re-downloading plugins and themes with WP-CLI ⇢ remkus.devries.frl/notes/force-re…

  2. This Article was mentioned on brid-gy.appspot.com

  3. This Article was mentioned on brid-gy.appspot.com

  4. This Article was mentioned on brid-gy.appspot.com

  5. This Article was mentioned on brid-gy.appspot.com

  6. This Article was mentioned on brid-gy.appspot.com

  7. This Article was mentioned on brid-gy.appspot.com

  8. Ramon Fincken Avatar

    Perhaps also this first to cleanup a bit?

    inactive_plugins=wp-cli plugin list --status=inactive --field=name

    echo "*** Removing inactive plugins: "
    echo "$inactive_plugins"
    wp-cli plugin delete $inactive_plugins

    1. Remkus Avatar

      Thanks, Ramon. Those are great additions, yes. Thanks for sharing!

Leave a Reply

Your email address will not be published. Required fields are marked *