WordPress provides a really easy way of installing all kinds of updates, but the truth is that sometimes things don’t go as planned. I had my share of update-crashes, and it’s nothing nice to have your blog, or worse – your client’s blog, unavailable for a number of hours until you fix the problem.
Here’s the thing. In essence, WordPress is a really thought through piece of software, and updating it is hassle-free in some scenarios. Yet those scenarios rarely ever occur because hardly anyone uses zero plugins and runs their blog on the default theme.
Plugins are the main cause of most of the problems when updating WordPress. Those are the ones you have to be careful with. So what I’m about to do is share a strategy I’m using for updating WordPress. This is something I’ve learned after having a modest number of crashes (most of them happened at the time when I was using something like a gazillion plugins at the same time).
When to update
I’m sure that you’ve noticed this too… every time you go to your admin panel there’s a message that something needs to be updated immediately or the world will end.
I, respectfully, disagree and completely ignore those messages. If I were to install each update the minute it appears I’d have to do nothing else than that for the whole day, every day. What I do instead is perform all updates once a month. A period of 30 days is enough to gather a nice package of updates for various plugins and WordPress itself.
Checking the Codex
The first thing I do is I go to http://codex.wordpress.org/Updating_WordPress, and make sure that there are no new items on the list since my previous update. Most of the time there’s nothing new there, but who knows, one day something will change, and if you don’t visit this page, inevitably, it’s going to be the day your blog crashes after an update.
Now, the Codex gives you a step by step advice, but I don’t follow it exactly. I mean, it most likely is one of the best ways of performing an update, but in most cases it’s not doable for a normal human being.
OK, the first thing the Codex tells you to do is to make sure that your server meets the requirements, and this I do. Here are the minimum requirements of WordPress. Or in plain English – what needs to be installed on your web server for it to be able to run WordPress.
It’s highly unlikely that your server doesn’t meet the requirements because web hosts are ALWAYS a step or two in front of developers, but it’s still worth checking.
Important. If your host somehow doesn’t step up to the minimum requirements don’t even think about updating. The update will go through anyway, but you might stumble upon a number of strange problems afterwards – ones no one would be able to help you with.
Always back up before doing any kind of updating. You need to have an archive of all the files and the whole database just in case everything crashes epically. Sometimes it’s easier to bring the site back using a backup than reverting the updates by hand.
We were talking about backing up WordPress in one of the previous posts so feel free to check it out and craft your specific strategy.
The Codex instructs you to disable all plugins before backing up the core of WordPress. I say that it’s not a real life possibility. If you go ahead and disable every plugin by hand you will end up with a site that looks like a big pile of ‘guess what’ for some amount of time. No SEO, no social media, no contact forms, no spam protection, and so on. Sorry WordPress, but this is simply unacceptable.
Going into a maintenance mode is a solution. But it’s nothing nice for your visitors to see when they just happen to step by. I go for a different route, and update all the plugins first. Manually, not in bulk. Then I make sure that they are still working like they used to.
Why am I starting with the plugins? Well, they are the source of all problems, and a great deal of those problems occur when an old version of a plugin doesn’t want to cooperate with a new version of WordPress, so instead it decides to crash the whole site.
By updating the plugins first I’m protecting myself against this because by the time I’m updating WordPress the plugins are already at their newest versions – the ones most likely to work fine.
Updating the core of WordPress
Finally we can do what we wanted to do in the first place. This is when I press the update button and hope everything goes well. Luckily, ever since I’m using this strategy, it does. Sometimes the admin panel looks a little strange immediately after an update, but when you go to the Dashboard everything gets back to normal.
Of course, immediately afterwards you need to make sure that your blog works and looks fine. Go to every page that uses a different page template (pages, categories, posts, search results, etc.) and do some basic sniffing around.
This is a straightforward task, so there’s nothing more for me to say here.
Checking your hacks and hooks
Even though your blog looks all right not necessarily everything works fine. If you’ve been using any functions.php hacks or WordPress hooks you need to make sure that they’re still working.
Now, a scenario in which WordPress decides to turn off a given hook out of the blue with no warning is highly unlikely, but some hooks have been on a depreciated list for a while now, and eventually they will be turned off. If you’re using one of them you can be in trouble, and at first, not even notice this.
What I usually do is I go through every custom thing I’ve created in functions.php and check if it’s working like I waned it to. It doesn’t take me more than 3-5 minutes, so it’s time well spent.
Backing up again
The last step is to create another backup. This is going to be the first backup of the new updated version of your blog. I’m doing this to have a copy I can use just in case I do some additional tweaks to the blog later on, and they don’t turn out that well. And of course, doing one more backup can’t possibly hurt you.
This summarizes my way of updating WordPress. I know that there’s a number of steps here, but it never takes me more than 30 minutes, and it seems like a fair amount of time to spend on updating your blog every month.
What’s your approach? Do you update WordPress every time a notification pops up, or do you wait until there’s a bigger package, and then handle it all at once like I do?