WordPress

Create a WordPress staging site in cPanel

Build a private WordPress staging copy on a subdomain in cPanel, keep it out of Google, test changes safely and push them back to the live site.

IntermediatecPanel hosting3 min read

A staging site is a private copy of your live site where you can test plugin updates, a new theme or PHP version changes without visitors noticing. On MdmHost you can create one in a few minutes on a subdomain such as staging.example.com.

Before you start

  • Enough free disk space for a second copy of the site (check cPanel → General Information → Disk Usage).
  • A recent backup of the live site.

Option A: Softaculous staging

If WordPress was installed with Softaculous, it can create staging copies for you.

  1. Open cPanel → Software → Softaculous Apps Installer and click the Installations icon.
  2. Next to your WordPress install click the Create Staging icon.
  3. Choose the protocol and domain, enter staging as the directory or pick a subdomain, and set a new database name.
  4. Click Create Staging and wait for the copy to finish.
  5. When you are ready, use Push to Live from the same Installations list, choosing whether to push files, database tables or both.

If the site was installed manually, use Softaculous → Import to register it first, or follow option B.

Option B: manual copy on a subdomain

  1. Create the subdomain in cPanel → Domains → Domains → Create A New Domain, for example staging.example.com with document root staging.example.com.
  2. Copy the live files: in File Manager select everything in public_html (except other sites' folders) and use Copy to the new folder, or compress and extract.
  3. Create a new database and user in cPanel → Databases → Manage My Databases.
  4. Export the live database in phpMyAdmin and import it into the new database.
  5. Edit wp-config.php in the staging folder with the new database details.
  6. Replace the URL in the staging database, for example with WP-CLI from the staging folder:
wp search-replace 'https://example.com' 'https://staging.example.com' --all-tables

Keep staging private

  • In staging WordPress tick Settings → Reading → Discourage search engines from indexing this site.
  • Add a password with cPanel → Files → Directory Privacy on the staging folder so neither visitors nor bots can see it.
  • Disable outgoing email or set an SMTP plugin to log only, so staging does not send order or newsletter emails to real customers.
  • Pause scheduled jobs from plugins such as backups to remote storage, so they do not overwrite live backups.

Test and deploy changes

  1. Make your changes on staging: update plugins, switch PHP version in Select PHP Version for the subdomain, or activate the new theme.
  2. Click through key pages, forms and checkout.
  3. Repeat the same changes on live, or push from Softaculous. Pushing the database overwrites live content, so avoid it on shops or busy blogs where new orders and comments arrive constantly.

Warning: Pushing a staging database to live replaces orders, users and comments created on the live site since the copy was made. For stores, push files only and redo settings by hand.

Troubleshooting

  • Staging redirects to the live site: the URL search and replace was skipped, or WP_HOME/WP_SITEURL constants in wp-config.php still point to live.
  • No SSL on staging: run AutoSSL from cPanel → Security → SSL/TLS Status after the subdomain resolves.
  • Login fails: clear cookies; both sites set cookies for similar domains.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.