Don't want to lose sleep over your website going down? Get a staging site.
You have a successful website. You're happy because you got your site up and running quickly on a tight budget.
Now, your website is the main source of your customers and sales. As your business grows so does your need for more functionality and plugins.
A few times a month, you make content updates and do software upgrades to your site all by yourself. You've never had any problems—you think running a website is a piece of cake.
Then, one day after you just updated a dozen or so plugins, you start getting emails from customers, WordPress, and even Google. The emails say that you have a serious issue with your site.
You bring up your browser and try to pull up your site. All you get is a blank white screen.
This nightmare scenario happens all too often. The good news is, it can easily be avoided if you use what's called a staging site or staging environment.
A staging site is a separate copy of your live website. The key words being: separate and copy.
Because a staging site is separate from your live site, you can do things like upgrading WordPress, your theme, and your installed plugins without affecting your live site. And, since a staging site is a copy of your live site, you can make changes and test the changes on a staging site as if it was your live site.
After you verify that the changes you made on staging look good and work the way they should, then you can make those same changes on the live site. Testing updates on a staging site before applying the updates on your live site helps ensure:
- Your site is still fully functional and continuing to deliver your online offerings.
- There's no disruption of your online presence that you rely on to promote your brand awareness and preserve your credibility.
- There's no loss of revenue and customers because of unplanned downtime.
- No search engine penalties from non-working pages or missing content (e.g., 404 or 500 errors).
- There's no loss of precious site content or customer data—namely for membership and eCommerce sites.
- Your brand, credibility, and domain authority are protected.
Staging sites don't have to be just for testing plugin updates. They can be an entire development environment for a new site, a place for troubleshooting and fixing an issue, or even a performance and scalability testing lab.
If you care about your business and your customers, you shouldn't be experimenting or making untested updates on your live site.
Does the phrase, "a copy of your live site" set off your SEO warning bells? Don't worry. You can password protect staging site (recommended). You can also tell search robots not to index your staging site. That means they won't affect SEO standings of your live site.
OK, just because you have a staging site doesn't mean you're completely in the clear. They can be misused just like any other tools in your toolkit.
In this article, I'll guide you through 8 best practices for using a staging site.
Please note that I'll use the words staging site, staging environment, and staging to all mean the same thing. I'll also refer to the live site as production.
A full backup means that all the files that make up your site are copied to a safe location. This is opposed to a partial backup where you can select to back up only parts of your site. A full backup includes WordPress core files, theme files, media files, and database (DB) files.
I recommend that you always make a full backup of your live site before creating the staging site copy. You can quickly restore everything back to normal from the full backup if needed.
You should always take another full backup of your live site when you make any changes to it.
These full backups are your insurance policy for when the live site becomes corrupted at any point during the process.
It's important to note that there's a difference between a daily backup and an instant (unscheduled) backup—sometimes called a snapshot. A snapshot taken just before updating the live site is good to practise for minimising data loss.
While working in staging, you should disable all email notification.
You definitely don't want to inadvertently flood your customer's inboxes if the work you're doing on staging is kicking out email notifications all over the place.
There are plugins that can temporarily disable notifications, yet log them for you as if they are sent. This is an awesome way to test emails without spamming everyone.
It happens to all of us.
After we make a simple change we reload the page to see it, and it's not there. We hit reload a couple more times—still nothing.
We go back to the change. The change looks good.
We hit the save button just to be extra sure. We click reload again. Nothing.
We're just about the scream before we realise we should clear our caches.
Assuming your change doesn't have an error, you save your work, and you're looking at the right page, this problem is almost always due to caching.
To save time and your sanity, I recommend disabling your caches while you are making changes in staging. Only enable them when you are doing performance testing or to make sure there are no plugin conflicts if you use a caching plugin.
Make sure you clear your caches on the live site too when you push changes.
Your production database should be the single source of truth. Treat it like your personal gold mine. Therefore, never contaminate it.
This means, never push your staging database to your live site.
Overwriting your production data from staging is never a good idea.
Some automated staging tools don't even permit pushing the staging DB to production. That's a good thing.
As I mentioned above, full backups are the only way to fly.
You might see options in your dashboard for backing up only the database, media, theme, or plugins. When it comes to working with staging environments, don't take partial backups.
You need to make sure you can always restore your complete site—not just pieces of it.
There are two big reasons you shouldn't keep your full site backup on your website.
First, if your server crashes and all files are lost, your most recent full backup is also gone.
Second, your backup file(s) takes up disk space. Depending on the size of your site, your backup files can be humungous. Your available disk space could shrink to nothing if you have an increasing stockpile of backups on your site.
Your site will screech to grinding halt when you're out of disk space.
Just say no.
Hosting plans that support staging sites usually create them with private access by default. However, you should always check especially if you manually created your staging site.
Staging sites should be controlled environments so you know what's happening to the site at all times. Password protect them.
Otherwise, you can be wasting precious time chasing your tail trying to figure out why the changes you made yesterday aren't working today.
And please remember. You don't want your staging site to show up on search results either.
If your site is mission-critical, you'll lose revenue and customers when your site goes down.
You should never automatically update your WordPress version, your active theme, and any active plugins. Having auto-updates turned on is a recipe for disaster.
You'll need to check with your hosting provider's policy to see what their default update settings are. If they default to any kind of automatic updates, then you'll need to know how to disable them.
I recommend that you always use a staging site even for updates that seem completely harmless. Conversely, I don't ever recommend using your live site to test changes or try out new things.
Unless of course:
- Your live site is private and has no visitors except for you.
- Your live site is public, but no one cares if it's up or down.
Cost used to be a factor for skipping the use of a staging site. Luckily, more and more hosting providers offer free one-click staging environments.
With increasing support for staging sites, there's no reason to find out the hard way that running your operations without a staging site is a costly mistake.
Let's face it, having a website (whether it's on WordPress or not) requires continuous care and feeding. If you want a healthy and safe website that's always running the latest/greatest features, investing in a staging site is a no brainer.
- This article is a lean version of the original I wrote for the Uncanny Owl blog.
- Hero image is a photo I made at the Hard Rock Cafe in Kuta, Bali while covering a gig for Mata Jiwa and Navicula in 2018.
- All other images by mark l chaves unless otherwise stated.