How Anyone Can Create a Staging Site for WordPress

Do you run your site on WordPress? When a new update is available, do you click the convenient update button in your dashboard? If so, this will help you understand why that’s about as smart as playing with fire. If your business depends on your website, you’re putting your business at risk. Instead, you should consider setting up a WordPress staging environment (And of course, always have backups).

WordPress is one of the most user-friendly content management systems that’s ever been developed. It allows just about anyone to create and manage their own site without a lot of time investment or a steep learning curve. Everything can be managed and updated right there in the dashboard, including WordPress itself, the theme and any plugins. Sure, being able to make changes and update everything immediately and on the live site is convenient. But it could also lead to trouble.

Any professional developer knows that changes to a website should be tested before being applied to your live site. You never know if updating that plugin, updating to the newest version of WordPress or making that nifty little design change is going to break your site. Many people have made the mistake of making these changes on a live site only to realize moments later that their site now displays errors or worse – the “white screen of death”. This is why you need a staging environment to test changes before applying them directly to your site.

 

What is a WordPress staging environment?

A staging site is an exact copy of your live site, but it’s not available to the public. It resides on, preferably, the exact same hosting, same server setup, same everything. It’s here that you want to hit that update button when a new version of WordPress is released. It’s here that you want to install a new plugin to test out or make any other type of change to your site. Not on your live site.

If something breaks when you make a change, it won’t affect your real site. It’ll still be the same as it was before. This way, you don’t risk your site unexpectedly going down and not being available for customers. And you don’t have to put up an annoying “site down for maintenance” for would-be visitors. Being down or even having “maintenance” on the front end can make your business look bad and unreliable. If your site goes down often or for prolonged periods of time, it can even affect how your site ranks in Google and other search engines.

Essentially, you want to use a staging environment because:

 

  • You can test any changes without feeling rushed to get your site live again and out of maintenance mode
  • You can add features, change themes, update versions… test any change you want without worrying about breaking your site
  • You don’t run the risk of customers and visitors turning to a competitor when they originally wanted to buy from you

 So how do I create a WordPress staging environment?

There’s not a one-size-fits-all method of setting up a staging environment. It mostly boils down to how much technical know-how you have, how much you want to spend and how much time you have. So we’ll look at several different ways you can do it that are ideal for different situations.
 

WP StageCoach

Cheap and easy

If you can afford $10/month (billed annually) or $12/month (billed monthly) and want a super easy way to create your staging site, then WP StageCoach might be just what you’re looking for. After you install the plugin and enter your license key, you’re one click away creating the staging environment and another click away from pushing changes to your live site after they’ve been tested.

Of course, there are additional options you can take advantage of along the way, too. You can choose the URL you want your staging site to be setup at or set a password to be able to view it. If you’re setting this up for a client, you can tell it to delete settings when the plugin is disabled so the client can’t use it later with your API key. And after you’re done importing changes to your live site, you can even reverse it if something wacky happens.

It’s extremely easy to use. However, one thing to consider is that if you use this option, the staging area will be hosted on their servers. The server your site on might not be set up the same way theirs is, so there’s potential to run into problems. Ideally, as mentioned earlier, a staging environment will exactly match the environment your site is in.

 

WP Staging plugin

Free and easy, but mostly just for testing

The next method is using the WP Staging plugin, which right now, has over 10,000 active installs and has a 5-star rating. The developer, Rene Hermenau, says it’s a work in progress but is well tested. He’s very active, communicates with users when there’s a problem and seems to fix problems quickly. It’s easy to use and creates your new staging site quickly. The admin dashboard of the staging site will always display a message to remind you that you’re working in the staging area and not the live site. You can’t push changes made in the staging area to the live site, though. So for now, it’s mainly a way to create a testing playground. In essence, that’s fine. You can test changes to make sure nothing is going to break and if everything works fine, then you know you’re good to go for making the changes on your live site. It just requires a little more time than if you were able to automatically push changes from the testing site to live site.
 

 

Manually create your staging site

Free, more time and know-how needed

Of course, you can always set up your staging site manually. It’s not as quick and easy, but it’s not as difficult as you might think either. First, setup a sub domain in your cPanel. If you aren’t sure how to do that, you can follow this guide.

Next, install WordPress on your newly created sub-domain. Since you already have a WordPress site, you probably know how to do this. If you don’t, it’s easy… just open a ticket and our support team will install WordPress for you. You don’t want Google or any other search engines to see this site. So, go to your dashboard after you’ve installed WordPress. Look for Settings on the left side panel and click on the Reading section. Here you’ll see an option to “Discourage search engines from indexing this site”. Put a check there and save.

If you don’t want anyone to be able to access the staging site, you can password protect it. You can do this with the Password Protected plugin or you can do it manually in cPanel. If you don’t want to add another plugin and prefer to do it manually, follow these steps:

 

  • Login to cPanel
  • Go to the Files section and click on Directory Privacy
  • Find the directory where you installed the staging site and click on the name of the directory/folder
  • Check the box for Password Protect this Directory and enter a name for this directory that will be displayed if someone tries to visit it
  • Click Save
  • Put a name and password into the Create a User fields and save

 

Now if someone tries to visit the URL of your staging site, they’ll have to login to be able to view it (with the user information you just created).

The last thing you need to do is copy your site into the new staging site. You can do this with a plugin like Duplicator, which WPKube has a guide for here. Or you can also do this manually if you prefer. Inbound Now has an in-depth guide you can follow for that here.

At this point, you should have a fully-functional staging environment for your site where you can test out any changes without risk to your live site. However, you still have to make the changes to your live site manually if you haven’t setup a way to push changes to your live site.

These are just a few of the many ways you can deploy a WordPress staging environment. Do you have another method of staging your site that you’d like to share?