How to Create a WordPress Staging Website

Create a WordPress staging website

A staging website is the perfect environment to test updates, themes and plugins before implementing them on your live site. In this article we’ll explain what a staging site is and how to create a WordPress staging website.

What is a Staging Website?

A staging site is basically a copy of your live website where you can test changes and updates without the risk of downtime on your live site if there are problems. A staging site is not visible to the public and changes you make won’t affect your live site.

How to Set Up a WordPress Staging Website

There are various ways to set up a staging website but the method you use may depend on your hosting plan and your technical ability.

Create a Staging Site Through Your Web Hosting Provider

If you have a managed WordPress hosting plan, the chances are your web host has a staging option available. Website hosting companies usually have their own specific instructions for creating a staging website so it’s a good idea to reach out to your host if you need help.   

Manually Create a WordPress Staging Website

If you have a normal shared hosting plan you probably won’t have access to the staging option mentioned above. You can however still create a staging site although it requires a little more work. Here’s how to create a staging website in a subdomain.

What is a Subdomain?

In the Domain Name System (DNS) hierarchy, a subdomain is a domain that is a part of another (main) domain. For example, if a domain offered an online store as part of their website, it might use the subdomain .

1. Create a Subdomain with cPanel

  • Log into your hosting account cPanel and scroll down to Domains. Click on Subdomains.
Domains section in cPanel
  • In the subdomains screen, enter the name of the subdomain you want to create – we’ve called it “staging”.
Subdomains screen in cPanel
  • Click Create and you’ll have a new subdomain for your staging website.

2. Install WordPress in the New Staging Subdomain

You can easily install WordPress with the Softaculous Apps Installer from your cPanel account. Scroll down to the Softaculous Apps Installer section and click on WordPress.

Softaculous Apps Installer in cPanel
  • In the WordPress interface, click Install Now.
Softaculous WordPress install screen
  • In the WordPress installation screen, select the new subdomain we created.
Softaculous software setup screen
  • Complete the rest of the setup form to complete the installation process.

Create Your WordPress Staging Website

At this point we have a brand new WordPress installation in our staging domain. If you go to your staging website now it will only be a default WordPress installation with no content.

The next step is to make a copy of our live website and replace the default site in the staging subdomain with the copy. We’re going to use the All-in-One WP Migration plugin to do this.

Step 1. Install All-in-One WP Migration on the Live Website

  • Hover over Plugins in your WordPress dashboard and select Add New.
Add a plugin in WordPress
  • In the Plugins screen, search for All-in-One WP Migration with the search bar in the top right hand corner of the screen. When the plugin shows on the page, click Install Now.
Install All-in-One WP Migration pluging in WordPress

The plugin will now be installed on your live website and can be accessed from the main menu.

Step 2. Export Your Live Website

  • Click on the All-in-One Migration link in the WordPress dashboard menu. This will bring up the Export Site screen. Click on Export To and select File.
Export File in All-in-One Migration WP Migration
  • You’ll need to sit back for a few minutes now while the plugin does it’s thing. Once the export is complete, click on Download and save the file somewhere on your computer where you’ll be able to find it later. When the download is complete you can click Close.
All-in-One Migration file download

Step 3. Install All-in-One WP Migration on the Staging Website

In order to import the file we have just created, we need to install the All-in-One WP Migration plugin on our staging site. The process for installation on the staging site is the same as we used in Step 1.

Step 4. Import the All-in-One WP Migration File to our Staging Site

To import the the file we created in Step 2, hover over All-in-One WP Migration in the WordPress dashboard and click Import.

Import with All-in-One WP Migration
  • Select the file we saved earlier and click on Proceed at the following prompt.
Proceed with import in All-in-One WP Migration
  • You can sit back again while the file is imported. When the import is complete you can click Finish an you should have an exact clone of your live website in the subdomain we created earlier.
Import successful in All-in-One WP Migration

Important Note on Importing with All-in-One WP Migration

We used the free version of the All-in-One WP Migration plugin to test the procedure in this post. The free version should allow you to upload files up to 512 MB in size. The new version of the plugin does however use the Maximum File Upload Size set on your server. If the upload size on your server is less than the size of the exported file generated by All-in-one Migration, you won’t be able to import it to your staging site.

In this case you have two options. You can either upgrade to the premium version of the plugin or you can increase the maximum file upload size on the server hosting your website. WPBeginner have instructions on How to Increase the Maximum File Upload Size in WordPress.

Increasing the file upload size on the server may not be possible with some shared hosting accounts. If you have problems or are unsure, always reach out to your hosting provider.

Securing Your Staging Site

As the site we’ve created is only for staging purposes, we don’t want it to be accessible to the public. To restrict access and prevent search engines from indexing the staging site, we need to password protect the subdomain.

It’s fairly straight forward to password protect our staging subdomain with cPanel.

Password Protect a Subdomain Using cPanel

  • Log into your cPanel and scroll down to the Files section.
  • Click on the Directory Privacy icon.
The Directory Privacy icon in cPanel
  • In the Directory Privacy screen, scroll down and open the public_html folder.
  • Find the Staging folder and click Edit.
The Directory Privacy screen in cPanel
  • Click on the Password protect this directory checkbox.
  • Type in a name for the protected directory and click Save.
  • You’ll now need to create a user and password to grant access to the protected directory. Write these details down and keep them in a safe place.
  • Click Save.

Your staging site should now be protected. If a user attempts to access the staging site through a browser they will now be prompted to enter a username and password.

A Local Alternative to a Staging Site

An alternative to a staging site on a live server is to create a local WordPress installation. This involves setting up a server and installing WordPress on your own computer. You can make a clone of your live website to use on local WordPress installation for creating new content, and testing themes or plugins.

A local installation is not a true staging environment however in that it uses a server you set up on your own computer as opposed to the live server provided by your web host. A local website will also only be accessible from the computer it is set up on.

Wrapping Up

You should never test changes, themes or plugins on a live website. Always test anything that could possibly break your website in a staging environment. A staging version of your WordPress website will eliminate the risk of downtime on your live site if there are problems with any changes you make.

Need Help with WordPress?

Please free to contact us with any questions regarding WordPress. Visit our home and services pages for more about us and what we do.

Cimeron Collins profile image

Cimeron Collins

Cimeron is an artist and designer with more than 25 years experience in the printing and publishing industries. He lives in Edenvale, South Africa with his wife Tamay.

Leave a Comment

Your email address will not be published. Required fields are marked *