Skip to main content
If you have a live WordPress website, it’s wise to avoid actions that could break your public-facing site. It is necessary to update and edit your site over time, but the problem arises when you apply major edits without testing them first. To avoid this, we advise creating a WordPress staging website with cPanel.

What is a WordPress staging website?

A staging website is a mirror image of your live WordPress website — a clone with the same features. It is also called a testing site or a development site. The public cannot view it because it stays in a separate subdomain that only you can access. Changes you make to it will not appear on the live site unless you want them to. Use a staging site if:
  • You have a new landing page you want to test before showing it to customers.
  • You want to check if updates are compatible.
  • You need to alter the website code to add a new function.
  • You intend to develop a new theme or improve an existing one.

Steps to create a WordPress staging site with cPanel

Log in to your web hosting account and find cPanel. We assume you already have an active WordPress website (so you have a domain name and URL).

Step 1: Make a subdomain

Log in to cPanel and locate Subdomains. Create your subdomain and give it a relevant name — this will host your staging website.

Step 2: Make an FTP account

Create a new FTP account to keep the new subdomain separate. Locate the FTP Accounts button, click it, and enter the new account details, including the directory of your subdomain.

Step 3: Add your WordPress files to the new site

The new FTP account lets you place files on the staging site. If you are not using the latest WordPress version, download it first, then upload the files. You can use cPanel’s File Manager to upload larger files, or use FTP throughout.

Step 4: Add your live site’s database

  1. Install and activate a plugin that helps you export and import database data (such as WP Migrate DB).
  2. Use the plugin to export data, entering the directory path and URL for your subdomain correctly.
  3. Create a new database for the staging site using MySQL Databases, then create a new database user and add them to the new database.
  4. Open phpMyAdmin, click Import, select the file you exported, and click Go.

Step 5: Modify wp-config.php

Edit the wp-config.php file on the staging site to use the new database name and username. Check your live site’s table prefix and make sure you use the same one. Upload the edited file back to the server, then log in to your new staging site using the same credentials as your live site.

Step 6: Restrict access

Stop search engines from visiting and indexing your staging website: go to Settings -> Reading, and enable “Discourage search engines from indexing this site”.

Conclusion

Creating a WordPress staging site with cPanel is an easy and quick exercise once you know how. With a staging site you can make changes without risking your main website, verify your edits, and then apply them to the live site without affecting its performance.