Update WordPress and Plugins via Command-line

Quite a few of our projects are built on top of WordPress. One of the side effects to having a great community of developers behind the CMS is that there are updates almost every week for the core and some of the more popular plugins. Each of our projects is versioned using Git, naturally, so manually dealing with these updates can be quite tedious. So how can we make our lives easier? Well, a command-line script would be nice. There are a few of these that exist. From shell scripts to a fully fleshed out PHP WP package manager. The problem with these is that they are made to work in a similar way the built-in WordPress updater works – update on the server, thus making the staging/production code out of sync with the repository. These scripts also use the database itself to get information about the website via the wp-config.php script. What if you don’t have a local database setup for the project?

This is the reason we wrote this little bash script which handles updating the core and all plugins without the need for a database, wp-config file or a domain name in one fell swoop. Checkout the open source project here on GitHub for more information.