WordPress makes it very easy to update your website to the latest versions of the WordPress core, plugins, and theme. Just click a few buttons, right?
Well, anyone who’s worked with WordPress for a while knows that simply pressing “update” without some serious preparation can be a recipie for disaster.
Here is a list of things you should do BEFORE updating your WordPress site!
1. Make a Backup
If you do nothing else on this list, please do this one thing: make a backup of your site. I like to use the free Duplicator plugin to do this. Sometimes it doesn’t work for large sites. If not, try Updraft Plus. Some web hosts like WP Engine have one-click backups in their admin panels (in addition to daily automatic backups).
2. Test the Live Site Before Updating
It might seem strange to test something that is supposed to be working before you even touch it, but I’ve had cases where a site wasn’t working properly after an update, and it turned out that the problem actually had nothing to do with the update.
Make sure the live production site is working properly BEFORE you do anything to it, or else the update could lead you on a wild goose chase while you try to figure out why your update “broke” the site (when it had nothing to do with it). Not to mention, this way you won’t be wrongly blamed for a site that was broken before you did your updates!
3. Take Screenshots of Important Pages Before Updating
I’ve had situations where I’ve updated a site, then wondered, “hmmm… was the space between the header and the body really that big before the update??” (In this particular case, nothing changed after the update; I was just paranoid).
Taking a screenshot of the Home page and any other key pages can calm your fears if you start to get paranoid and think something changed after the update. Or, it can confirm that the update did indeed break something.
A variation of this is to load some of the pages of the website in a separate browser window, leave them there, then open a new window to do the updates. Then, you can compare the new site to the old (just don’t accidentally refresh the windows with the pre-updated site!)
4. Keep a Log of Changes
When I update a site, I keep a log of every change I make. I note the old and new versions of everything I update. To make that easier, I copy the plugins section of the WordPress Updates page and paste it into a file. That gives me the old and new versions of every plugin that needs to be updated.
If something goes wrong, I have a list of plugins that could have caused the problem!
5. Check for Major Version Updates
Before updating, I scan the plugin version numbers to see if any are jumping to a new major version, like going from V2.9.2 to V3.0.5. If any are, I read the plugin notes to check for any compatibility problems with the new version. Same goes for themes, and the WP core.
6. Check for Recent Updates
Building on the previous point, if there has been a major update to a plugin or theme, I check to see when that update happened. If it was very recently, like yesterday, I will sometimes hold off on the update for a while and let other people be the guinea pigs to test the new version, rather than having it break my site.
7. Check Your Server’s Version of PHP
If you’re updating a site that hasn’t been updated in a very long time, there’s a good chance that it’s running an old version of PHP. Doing updates to such a site could be disastrous, because the new versions of the theme and plugins might not be compatible with your server’s version of PHP.
I like to use the Duplicator plugin to check the version of PHP. Go to Duplicator -> Tools -> PHP Information to see what version of PHP your server is running. Call a web developer if it is below 7.0.
8. Test Updates On a Staging Copy
Now that you’ve done a lot of the preliminary work, it’s time to test the updates on a staging site, i.e., a non-public copy of your site.
This can be a site hosted locally on your computer using a program like MAMP (kind of advanced), or a copy of your site online that your web developer can create for you. (Just make sure the staging site is running on the same version of PHP that your production site is).
WP Engine provides a free one-click staging copy for this purpose. Siteground offers staging copies, but you have to set up the subdomains in your DNS records first. Whatever way you do it, if you want to avoid downtime after a botched update, test on staging first!
9. Have a Recovery Plan
Sometimes, even when you do everything “right”, things go wrong. That’s why I make sure that I have FTP access to the website’s server and phpMyAdmin access to the database (or SSH access) BEFORE I update anything. That way, I know I have a way to restore the site if anything should go horribly wrong.
If you’re not a developer, then you should have a developer “on call” in case something goes south.
After the Update – Do Not Skip This!
OK, so you’ve done everything on this list, and clicked “update”, so now you’re done, right? Not quite. You need to test the production site thoroughly for any issues. Remember to clear all caches!
The one thing folks always forget to test is the contact form! Do a test submission and make sure the person at the other end receives the email. Do not skip this step!
Oh, and don’t forget to make another backup of your site, so you have a nice clean updated copy!
A Final Note
The steps I’ve outlined above should be considered the minimum you should do before updating a WordPress website. If you’re running an e-commerce site that brings in thousands of dollars per day for example, I would go over and above the steps I’ve outlined here.
Please leave questions and comments below! – Brian