The Best, Correct, Right and Only ;) way to update WordPress or WooCommerce!

As you may or may not be able to glean from my facetious title – its got a 😉 in it for this reason – I don’t think there is an only, right, best or most correct way to do really anything… all developers and store managers will find their own path.

But there are such things as Best Practices. And that is what I’m going to touch upon here, today, as I’ve seen recently that sometimes these things, which come so naturally and second nature to me now, aren’t necessarily as widely practiced as I would hope.

So below is a description on how to update your WordPress website, and then, a further little extended note about updating WooCommerce sites. The aim here is to prevent you from coming unstuck and, should the worst happen, to assist you at unstuckificating yourself.

Unstuckification is one of my core talents. If you have got stuck, then you may like to hire me at Codeable. I’m busy, though, so you may equally wish to talk to one of my great colleagues over there.

Anyway, enough self-promotion, onto the real point of this post…

How to Update WordPress

  1. Backup WordPress files and database – always do this. Ideally test your backup processes before you move forward, so you are sure you really could restore your site from this backup, too. Use your host’s backup, and also try plugins for this.
  2. Update all plugins to latest stable release (except WooCommerce, more on this below!). You can do this individually or in a big old batch. It depends on your system, how confident you are, and other things if you want to do a big batch. One by one is equally fine.
  3. Update your theme to latest stable release – whether you store bought a premium theme, or you downloaded one from the WordPress repo, if there’s an update available for your theme, do this next.
  4. Lastly, update WordPress to latest release – do this one last.

Why WordPress version last?

When WordPress versions change, sometimes the code in plugins and themes may break. Actually this is very rare that it will actually break anything. But if it does, by updating the plugins and themes first, you’re allowing the theme and plugin developers the chance to actually push their updated code to your site before the new WordPress version is added.]

Wait just a minute!

For this reason, unless it is a security release, it is sometimes worth waiting a day or two after a new WordPress version is released to update. Again, this allows theme and plugin developers time (and support requests!) to make their little code updates.

What if something goes wrong?! Eek. White Screen of Death (WSOD)!!

If you are met with a white screen of death or another WordPress error message. Firstly, as the Hitch-hikers Guide advised, do not panic.

What did you just do? Update a plugin? Which plugin? There’s your issue. Update a theme? Hmm, maybe something here.

First up, you can try renaming the plugins directory to something else. This will tell you if it is indeed plugin related (it basically disables all your plugins, by moving them “somewhere else” in one heap).

If it wasn’t a plugin, then it must be the theme. Rename the themes directory to something else.

If you still have a whitescreen, it may be caching related or seriously broken.

Replace, remove or fix the plugin or theme files causing the conflict. This may be best left to a developer. Post a task onto Codeable describing your issue.

If all else fails, roll back to your backup – it was stable and working, then, right?!

How to Update WooCommerce

Updating WooCommerce is a more complex process than updating WordPress – and naturally it should be so, because WooCommerce is taking transactions. There’s more to test, and more to “go wrong”.

Everything should be done and tested first in a “staging site”

What is a staging site?

A staging site is an exact replica – a copy or clone – of your live site, which is made to test new code in. It should live in the exact same hosting environment as your live site, so you know everything you do there will be similar in “real” conditions.

WooCommerce updates should always be done first in staging – and tested.

So what’s the process?

Now that we got the staging site idea out of the way… what is the actual process of updating?

  1. Backup everything on your live site – database, files, the lot.
  2. Clone live site to staging.
  3. In staging site, update all plugins except WooCommerce to latest stable release;
  4. In staging site, update theme files to latest stable release;
  5. In staging site, update WordPress itself to latest stable release;
  6. In staging site, update WooCommerce to latest stable release;
  7. If there is a WooCommerce database upgrade required, press the purple button to get this started;
  8. After this upgrade completes, visit settings, and put your gateway into test mode;
  9. Visit the store front end, and check all pages with templates – so home, store home, store category, tags, single product, add product to cart, cart page, checkout, complete checkout;
  10. After you complete the test purchase, make sure all the sale things trigger, like mail, order received, any custom statuses or whatever;
  11. Once you are satisfied, repeat the process in the live site (whatever method you use to push this live!)
  12. In the live site, I like to add a hidden product priced at (say) $1 and test the live gateway. This can sometimes reveal an error. In any case, for client work, it is the best way to demonstrate that checkout was working after update- by processing a real money transaction.

I fully advocate adding the collection of additional backups in between steps, wherever you see fit. How many and where, and the exact process really depends on the numbers of transactions your store is processing.

Why WooCommerce Last?

Same reason as for WordPress itself… you need to allow the plugins and themes to be compatible before you update. So this means buy licences for official extensions, and add your licence key!

Side Point – Don’t Version Jump from .ancient!

If you are running a “really really old” version of WooCommerce, do not simply update from dot ancient to today and expect everything to be okay. It probably will not be. Its worth taking this in a few leaps.

2.6 and 3.0 were big version jumps, requiring database updates.

Other versions too.

If you’re moving up from a version before (say) 2.5, I’d say consider asking a developer to do this. At least, expect to take it in steps. You can find old versions of WooCommerce here (dropdown at the bottom!).

Wait a minute!

With WooCommerce updates, I recommend waiting for one or two minor versions after a major update – so if it went from 2.0.x to 2.1, then wait for 2.1.1 or 2.1.2 to update. While in my day job at Silicon Dales we will test the Release Candidates on our own themes and our clients themes, you will save yourself some hassle and heartache if you let all the little bugs on the new version get ironed out before you hit update.

A note on affiliate links

This post contains my affiliate links, to Codeable and to WooCommerce. If you visit them through my links and go on to make a purchase, I may be paid some referral fees. I’m upfront about this. If you don’t like it, you are free to visit the sites and order without going through my links. The purchase will not cost more or less as a consequence!

Talk to me!

Leave a comment below if you think I should add something to this post – Open Source must be live to be of any use, and this process can always be improved. The main thing is to keep backups, proceed with caution, but do update. Always update. Its secure and sensible.

About Robin Scott

I'm Robin Scott, a WordPress Consultant and WooCommerce expert developer who, along with three other people, runs a business called Silicon Dales Ltd remotely, from a base in the North of the UK. I enjoy using my talents for programming to track and interpret sporting, political or retail data - and therefore you'll see me posting some content in these spaces in this, my personal website. If you're interested to talk about leveraging this for your business (in sport, entertainment, retail, etc) please contact me.

Leave a comment