Need help? Chat now!

Hostwinds Blog

Search results for:

How Anyone Can Create a Staging Site for WordPress Featured Image

How Anyone Can Create a Staging Site for WordPress

by: Hostwinds Team  /  June 15, 2017

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, it would be best if you considered 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 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 from 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 set up at or set a password 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 straightforward to use. However, one thing to consider is that the staging area will be hosted on their servers if you use this option. 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 uses the WP Staging plugin, which 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, 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 the live site.

Manually create your staging site.

Free, more time and know-how are 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, set up a subdomain in your cPanel. If you aren't sure how to do that, please reach out to us via Live Chat to help you.

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… follow this guide for setting up WordPress with Softaculous.

You don't want Google or any other search engine 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 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" field and save

Now, if someone tries to visit the URL of your staging site, they'll have to log in 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 manually make the changes to your live site if you haven't set up 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?

Share this guide if you've found it helpful.

Written by Hostwinds Team  /  June 15, 2017