A majority of the sites that we manage here at Busybee Marketing are made in WordPress. Third-party plugins and the official WordPress core are constantly being updating with improvements and security patches. That’s a good thing! But keeping up on those updates can be a pain, let’s go over how to update a WordPress site.
While you could very well perform these updates directly on your live website, the best way to update is externally first – catching and fixing any errors that might pop up. The good news is that updating a WordPress site will usually work without a hitch over 90% of the time. But, most developers – including myself – have been in the crazy situation where an entire site completely breaks due to one incompatible plugin, so below is our process of updating WordPress sites.
Backing up a WordPress site
If you’re not using a hosting solution that offers a staging environment (like WPEngine or Flywheel) you’ll need to update your WordPress website manually. If you are using WPEngine or Flywheel, you can skip straight to this section about hosted environments.
It’s better to have cPanel access in order to get this process done quickly and without error. Contact your hosting provider for more information on how to login and gain access to your cPanel instance.
Step 1: Perform a full site backup!
It’s important that you backup your website in case something goes wrong and everything breaks. Backing up your website only takes a few minutes and can save you countless hours upon hours of troubleshooting, support phone calls, hundreds of dollars, and/or facing the consequence of even losing content.
How to backup your site using your cPanel file manager
First of all WordPress is simple, it works by using a bunch of files and a database. Like everything that’s based on code, there’s no magic or secret involved and WordPress is no exception. It’s open-source, well-documented, and awesome for most things – small business websites being just one.
To make a backup using the cPanel file manager, first select all of the files in the root of your WordPress directory and click Compress to generate a zip file to download. It might take a minute or two depending on the size of your uploads directory and the speed of your server. Download that file to your computer when it’s done compressing.
Secondly, export your database using the PHPMyAdmin tool by choosig the correct database named in your wp-config.php file and click the Export button.
How to backup your site using Updraft
Updraft is a very helpful tool if you don’t have access to cPanel. Updraft is a free plugin that lets you download your site’s files and database both on-the-fly and on a schedule.
Backing up your website using Updraft is simple, after installing the plugin you are given the option to backup themes, plugins, database, and uploads to your computer or locally on the server once or on a reoccurring schedule – which will be very helpful in the long-run.
Just a note; I’m not a very big fan of installing any unnecessary WordPress plugins. Plugins can add unnecessary website bloat and open your business up to security vulnerabilities. Using the least amount of plugins as possible way less holes and is always easier to manage when done correctly.
Step 2: Pull the site down locally
There are lots of ways to run a WordPress site locally. Throughout my 10 years of WP development I’ve used WAMP, MAMP, XAMP, Vagrant, and a basic PHP/SQL server. My current favorite is Local by Flywheel. It’s free, simple to use, and has many other features that make the process of website development fluid and seamless.
However you decide to run the site locally, you’ll still be using the files and database that we exported back in step #1. If you have questions on what tool is right for you, contact us and ask – we’re more than happy to help.
The zip file will then be extracted to the containing directory and the SQL file imported into the appropriate database. Doing so will/should replicate what you have running on your production server.
Make sure the PHP version that your local site is running is the same as what is running on your server. It’s important to have the least amount of different variables when you update a WordPress site.
Step 3: Replace the live site URL with the local URL
As most WordPress tasks are concerned, there is almost always a plugin available – but think twice before going plugin-happy, because the more plugins, the more problems, and the more updating you’ll be having to do in turn!
The best, easiest, non-plugin tool to replace database strings out there is called Interconnect, it’s a free downloadable directory of small scripts that you add to the root of a WordPress site. Once you visit the URL (e.g. example.local/db-replace) a simple UI will let you search and replace strings throughout your entire database. Be sure you delete it afterwards, it’ll open up your site to hackers if not!
And if needed, that same tool should be used pushing your website back to production by reversing the URL references.
Step 4: Update the site’s core & plugins locally
Hey, we made it! All of this work has lead up to the most important task of updating WordPress. Luckily it’s pretty simple, click Update on plugins and then Update on themes – hopefully everything works as it should once you’re done.
90% of the time these updates will be hassle-free, with the following exceptions:
- WooCommerce updates can require modifications if you’re using custom templates
- Major WordPress updates (e.g. 4 to 5, 5 to 6) will usually come with big changes that can break sites
- Sites that are dependent on many plugins will have more compatibility issues than those that aren’t.
If there were issues after the update then at least you’re fixing it locally and your site is doing just fine and Busybee Marketing can help with solving WordPress maintenance issues if you’re unable to figure out what’s going on.
Step 5: Push the site back to production
After everything looks good it’s time to push your website back to production. You have a decision to make based on what happened with those updates in step #4:
If issues had to be fixed, replace the entire database and file system
If there were issues that had to be fixed, and your website has been frozen (no content/comment/post updates between the time of pulling it down and pushing it up), then it’s probably best to replace the entire site’s files and database via cPanel. You can refer to step #3 to revert the URLs in your database to reference production.
If no issues had to be fixed, replicate the updates manually
If there were no issues due to updating plugins or WordPress, it’s better to simply make the same changes on the live server. Why? Updating locally in the same environment as production will replicate what will happen when updating your live website.
Update a WordPress site via deployment
If you’re using a deployment system that utilizes testing environments then it’s easier to update a WordPress Site. While updating still should be done externally to your production website, the process of doing so has far less steps (at a monetary cost).
Due to the fact that updating a WordPress website is much easier using a system such as WPEngine, the list of steps are much shorter:
- Pull down a fresh copy of the site to staging
- Update the site core & plugins locally
- Push the updated site back to production
Other things you can do while updating your WordPress website
Might as well do some other stuff while you’re in the process of updating your website. Busybee Marketing offers maintenance plans that handle the processes above and also any extra helpful tasks, check out all of our digital services here.
- Clean up any spam
- Clear the cache
- Do some search engine optimizations