The importance of having a WordPress staging site to test changes and updates

two flowers facing each other

If you’re building or publishing with WordPress, you need to have at least two WordPress sites for each project you launch.

The first one is obvious: it’s the WordPress site that the rest of the world sees and uses.

But the second one might not be so obvious: it’s a staging site (sometimes known as a development site) where you can make and test changes without worrying about affecting your regular users and readers.

A staging site is a copy of your main site (sometimes called the “live” or “production” site) with all the same posts, pages, content, settings, themes and plugins but with its own website address / URL and login. Many WordPress hosts now even offer built-in tools to help you quickly copy your live site into a staging site without having to manually copy files or export and import content.

Here’s why having a staging copy of a website can be essential to its success:

Testing plugin and theme updates

WordPress auto-updates and various automatic update tools out there do some kinds of testing for you when attempting to update the themes and plugins on your WordPress site. If the update immediately causes a critical site error or clearly breaks the content on the front page of your site, those systems can usually catch the problem and prevent the upgrade from going forward.

But there really is no substitute for manually reviewing the outcome of updating a group of plugins or a theme on your site. Even without a fatal error, there are all kinds of problems that can come up.

Just this week, a WordPress site I help with successfully updated all of its plugins and the site appeared fine at first. But, as caches expired and new scheduled jobs within WordPress ran, the site slowly deteriorated. The hero image at the top of the front page no longer displayed. The list of upcoming events was missing. And various other content elements were either malformed or completely gone. What was the issue? One of the plugins that had been upgraded made a behind-the-scenes change in a library it used for fetching remote content, and that change conflicted with other plugins. It was a bug that wasn’t easily caught by automated testing tools, and unfortunately was only noticed by our users.

If the updates had been run on a staging site first, there’s a good chance the issue would have been caught. Not only would this have prevented users from seeing a broken site, it also would have helped those of us managing the site avoid that stressful feeling of rushing to fix something on a live site.

Exploring new features

The possibilities for adding new functionality to your WordPress site are endless, especially with all of the great themes and plugins available out there. Some features are small and self-contained enough that you can just install and “turn them on” on your live site without worrying too much. But many kinds of new feature functionality can have far-reaching implications for the content, design and layout of your existing site. So it’s almost always a good idea to test new features on a staging site first.

Something like installing and activating a new plugin or theme on your staging site removes all of the worry from the process. If it breaks everything, no big deal. You can uninstall, set the staging site back to the way it was, and try something else. This is also true for CSS changes, rearranging content structure, trying out different page or post templates, or implementing redirects. All of these things can be tried and tested stress-free when you’re working in a development environment that no one else cares about.

Then, when you’re sure everything is working as expected, you can repeat those steps on your live site. But without a staging site, the same kind of experimenting on a live site might mean hours of restoring the site to the way it was before you started, if things go wrong.

Comparing environments during debugging

When troubleshooting an issue with WordPress, it can often be helpful to determine if the source of the problem is related to the way a specific site is configured. “Does this plugin cause the same problem on a freshly installed WordPress site using a really basic theme?” If the answer is yes, then you know the bug is probably with the plugin itself. If the answer is no, then you might have to keep looking for something more contextual in your WordPress site’s setup.

Staging environments can make it fast and easy to debug a problem using different base themes, with some or all of your other plugins deactivated, and with total control over other factors that might be triggering or influencing the problem. They quickly give you more information about what’s happening and what next troubleshooting steps might be.

Finding hidden problems

WordPress has all sorts of debugging tools available, from the built-in DEBUG mode to great plugins like Query Monitor or Debug Bar. But most of these are not tools you want to run on a production website because they can affect performance or change what your users and readers see.

Having a staging site to turn on in-depth debugging tools is a great way to understand more about what’s happening on your site and where there might be more subtle problems that need addressing. It’s an uncached view of your staging site where you might learn that the front page is running 100 MySQL queries when it actually only needs to be running five. Or where you learn that a plugin you’re using has been throwing PHP warnings that indicate it will soon stop working altogether.

It’s important to have a staging environment where you can really develop a solid understanding of how your WordPress site works, what might be slowing it down or causing problems, and how to tackle those issues.

These are just some of the reasons that it’s important to have a staging site when developing, building or publishing with WordPress. The stability and security that WordPress offers out of the box is wonderful, but that doesn’t mean you should take unnecessary risks by making significant functionality changes directly on a live site, without having tested them elsewhere first.

Using a development or staging site, coupled with tools like WP Lookout, will help ensure a smooth experience for your users as you manage and update your WordPress site over time.