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
- Install and activate a plugin that helps you export and import database data (such as WP Migrate DB).
- Use the plugin to export data, entering the directory path and URL for your subdomain correctly.
- Create a new database for the staging site using MySQL Databases, then create a new database user and add them to the new database.
- Open phpMyAdmin, click Import, select the file you exported, and click Go.
Step 5: Modify wp-config.php
Edit thewp-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.