Skip to content

Instantly share code, notes, and snippets.

@iworks
Last active December 21, 2021 07:05
Show Gist options
  • Save iworks/cf653ff02e187d89eb1f410c5772c85e to your computer and use it in GitHub Desktop.
Save iworks/cf653ff02e187d89eb1f410c5772c85e to your computer and use it in GitHub Desktop.
Find and update WordPress
#!/usr/bin/env bash
# Marcin Pietrzak
# http://iworks.pl/
if ! command -v wp &> /dev/null
then
echo "wp could not be found! is wp-cli installed & configured?"
exit
fi
ROOT=/var/virtuals
for f in $(find ${ROOT} -type f -name wp-config.php)
do
DIR=$(dirname $f)
cd ${DIR}
wp core update
wp plugin update --all
wp theme update
wp language theme update --all
wp language plugin update --all
wp language core update
done
cd -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment