What Is A Staging Site And Why You Must Have One
If you’re actively working on your WordPress web site and you don’t use a staging site, you’re just asking for all kinds of trouble.
Updating or trying out new plugins, working on design, changing your theme or changing how your web site works on a live site, can result in a very unexpected outcome. Translation: NEVER test anything on a live site until you’ve first had a trial run on a staging site.
What Is A Staging Site?
Let’s start with the idea that the site your visitors see is your live site. (Most web hosts and developers refer to this site as your production site.)
You don’t want to do anything which may cause it to go down. Depending on the type of site you have, this could mean loss of revenue, membership, or even, over time, a loss in your position with Google – or it could be just downright embarrassing.
You certainly don’t want to pay someone to fix whatever you did that caused your site to go down.
In contrast to your live site is a staging site. This is an exact copy of your live site. It is where you can test out new plugins or see what a design change will look like before anyone else sees it. It’s where you can mess up and won’t suffer the consequences.
How easy or difficult it is to set up a staging site will depend on your web host. Hosts like WP Engine, Site Ground, and Kinsta – to name just a few – make it really easy to set up. Other hosts – GoDaddy comes to mind – have recently gotten into letting customers set up staging sites, but it’s not as easy as WP Engine (my favorite hosting company and recognized as the gold standard by many).
Where Is Your Staging Site Located?
Where your staging site resides will depend on how your host sets up a staging site. For example, this site (https://joyofwp.com) has its staging site at https://joyofwpstage.wpengine.com/.
The key is that the staging site is an exact duplicate of your live site when the staging site was created. This means that the server environment, SSL, and all other factors are the same.
But there is one difference.
A true staging site will not have server caching. This means when you try out new designs and plugins, you won’t have to deal with an older version of what you’re testing that has been stored via caching in your computer.
Note that while most staging environments have server cache turned off, some do have server caching. Make sure you know what you’re working with.
What If I Can’t Make A Staging Site?
What I’ve done for clients whose web hosting plans don’t allow for a staging site is to set up a clone site.
This is not a one or two click process. This involves manually copying all files, exporting them, setting up and importing a database, and hooking up a bunch of things to build the clone site.
This kind of site may or may not have SSL and it very likely will have server caching – which is not preferred. But at least you will have a copy of your live site. You don’t have to say, “I wonder what will happen if I do…” to your live site, only to see it fall apart following your trial of a plugin or a design change.
Should My Staging Site Be Password Protected?
You must keep away prying eyes from your staging site.
If your staging site is not password protected that means anyone can see it and it can be confused for your live site. Even worse, Google will find it and index it into their system. You don’t want that.
If you don’t want to set up password protection (and something that I like even better), then use a plugin like WP Maintenance Mode so that users and Google will see a “Coming Soon” message.
What Login Credentials Do I Use For My Staging Site?
Whether you have a true staging site or you’ve got a clone site, the WP Admin login credentials you will use are the same as those for your live site. Remember, it’s a duplicate of your live site.
When I Make Changes On My Staging Site How Do I Push Them To My Live Site?
Pushing staging site changes to a live site is a bit tricky but I have one rule.
Don’t move the staging site to the live site…ever!
Doing that would overwrite the database of your live site.
Keep in mind that the two sites – live and staging – are totally separate. While you are working with the staging site, people are visiting your live site. Maybe they’re adding a comment, placing an order or joining as a member. Perhaps you’ve added a new page or changed some copy on a post after you created your staging site. All of these change what is stored in your database.
If you move your staging site to your live site, you will overwrite your live site database – so don’t do that!
Then how do I implement the changes I have made on the staging to the live site?
The method of implementing depends on the changes you have made.
If it’s a new plugin, then just install the plugin to the live site. If you have made some styling changes then make a copy of the CSS file and place it in the theme’s folder of the live site. If you have made changes in the functionality of the site using PHP, do the same with the functions.php file.
The exception might be if your site is brand spanking new and it was developed in the staging environment. In this case, there is no live site to replace. Then you can move the staging site to the live environment.
You need a staging site (or some kind of duplicate site) to try out changes you wish to make to your live site. It’s that simple.