Lazy wordpress updating using wp-cli.phar

Fed up installing updates to WordPress sites? Stick this in a cron job somewhere, and cross your fingers (a little)….

set -x
set -e

for website in site1 site2 site3
   php wp-cli.phar --path=$DOCROOT core verify-checksums
   php wp-cli.phar --path=$DOCROOT core update
   php wp-cli.phar --path=$DOCROOT plugin update --all

You can download wp-cli.phar from

I’d suggest you don’t run the above as root.

Leave a comment

Your email address will not be published.