Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Shell script to keep updated wordpress core and plugins.
#!/bin/zsh
# -------------------------------------
# Usage: % ./wordpress_update.sh
# Author: Yuki Matsukura <matsubokkuri@gmail.com>
# -------------------------------------
# to be strict syntax checker
set -e
# set low priority
renice -n 19 $$
WPS=(
"/path/to/wordpress1/"
"/path/to/wordpress2/"
)
for i in $WPS
do
echo "Processing: $i"
cd $i
echo " Upgrading plugins."
wp plugin update --all
echo " Upgrading themes."
wp theme update --all
echo " Upgrading Wordpress."
wp core update && wp core update-db
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.