Skip to content

Instantly share code, notes, and snippets.

@markjaquith
Created August 5, 2016 13:17
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save markjaquith/a00fb7ade6815357ebeb9f1b598c64fe to your computer and use it in GitHub Desktop.
Save markjaquith/a00fb7ade6815357ebeb9f1b598c64fe to your computer and use it in GitHub Desktop.
Update all WordPress plugins using WP-CLI and make a separate git commit for each one
#!/bin/bash
PLUGINS=$(wp plugin list --update=available --field=name | tr -d '\r');
wp plugin update-all;
for plugin in $PLUGINS; do
git add -A "wp-content/plugins/$plugin";
git commit -m "Update plugin: $plugin";
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment