[updated: Sep 30th, 2018 | Cleaned up script, and references “perfect” plugin update system]

NOTE: Please checkout my “perfect” WordPress plugin update solution: http://blog.vpetkov.net/2018/09/30/easy-fully-automated-wordpress-plugin-update-system

When you host your own WordPress installation, and there is some sort of an update about every month or so, it can quickly get very annoying doing all the upgrade steps manually (for the people who do not have a CPANEL or FTP account). Now imagine hosting 5-6 WordPress installations. Now imagine 100+. Welcome to my nightmare. Eventually I caved in and wrote this:

So, to summarize, this will download the latest version of wordpress, unzip it, and move the new files accordingly.
At the end, it will remind you to “upgrade” your DB, just in case there is an upgrade. I highly suggest backing up your primary blog before you begin this, just because it’s the “safe thing” to do.
That said, in the 10+ years I’ve used this (started long before I posted something here) – I’ve never had anything go wrong!

3 Thoughts on “Script to Upgrade WordPress to the latest version fully automatically

  1. Thanks, this is great!

    Can you clarify what the $NEW and $OLD variables represent? I think $OLD is the location of your wordpress installation, and $NEW is a temporary folder where the wordpress distribution is unpacked, right? And $HOME is the folder that the wordpress distribution is downloaded to?

    Thanks!

    • Hey, $OLD (poor choice for a variable name) is the “full current blog path”. It builds on $HOME. For example, something like $HOME=/var/www and $OLD would be $HOME/myblog. The $NEW variable is a temporary folder where the new wordpress is unpacked yes. I will fix these with something that makes more sense, and update it in Git and on my blog. Thanks for pointing this out.

  2. Pingback: VPetkov.net » Script to Upgrade Pluggins on WordPress to the latest version fully automatically

Leave a Reply

Your email address will not be published. Required fields are marked *

>> NOTE: Please use <code>...</code> to post code/configs in your comment.

Post Navigation