UPDATE: Please check out latest version from my git repo: http://git.vpetkov.net/projects – project name: “wordpress”

When you host a WordPress installation for yourself, and there is some sort of an update about every month, it can get 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 500+. 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 things accordingly. At the end, it will remind you to upgrade your DB, just in case. I highly suggest backing up your primary blog before you begin this, just because it’s the “safe thing” to do.

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

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

  2. 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!

  3. 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.

Leave a Reply

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

Post Navigation