You have felt the fear: you click Update on a plugin, the screen goes white, and your live site is down in front of real visitors. A WordPress staging site exists to make that moment impossible. It is a private, working copy of your live site where you test updates, new plugins, theme edits, and PHP version changes before any of them touch production. This guide shows you how to create a WordPress staging site four ways — your host’s one-click tool, a free plugin, a manual WP-CLI copy, and a local install — then the safety steps that stop staging from emailing your customers or showing up in Google, and how to push changes back to live without losing orders or comments.
Last verified: 20 November 2026. Commands and plugin behaviour were checked against the official WordPress developer docs and the WP Staging plugin listing on the day of writing.
What a WordPress staging site actually is
A staging site is a complete copy of your live site — all its files and its full database — running at a separate address with its own database (or, in the free plugin’s case, its own table prefix in the same database). It looks and behaves like your real site, but nothing you do there affects production until you deliberately push a change back.
That separation is the whole point. Staging is where you:
- Test plugin and theme updates before they go live
- Try a new page builder, form plugin, or checkout flow
- Reproduce a bug your visitors report, with the same data and settings
- Check a PHP version upgrade before your host forces it on you
- Show a client a redesign without touching their live site
Staging is not a backup, and it is not a development environment you code in every day. A backup is a restore point for when things break; a staging site is a rehearsal room for changes you plan to ship. You need both.
Which staging method should you pick?
All four methods below end up in the same place — a working copy of your site — but they differ in effort, cost, and control. Pick by your hosting situation, not by which one sounds most impressive.
| Method | Best for | Skill needed | Cost | Push back to live |
|---|---|---|---|---|
| Your host’s staging tool | Managed WordPress hosting | Beginner | Included in the plan | One click, files and/or database |
| WP Staging plugin (free) | Hosts with no staging tool | Beginner | Free | Not in the free version — repeat changes by hand |
| Manual WP-CLI copy | Full control, any host with SSH | Advanced | Free | You choose exactly what travels back |
| Local copy on your computer | Design and development work | Intermediate | Free | Deploy by hand or with a migration plugin |
If your host offers staging, use it. It is the fastest path and the push-back step is built in. If your host does not, the free WP Staging plugin is the next best thing. Reach for the manual method only when you need full control — or when neither of the first two is available.
Method 1: Use your host’s one-click staging tool
Most managed WordPress hosts include staging. You click a button, the host copies your files and database to a private URL, and when you are done you push the changes back — usually with the choice to push only files, only the database, or both.
Kinsta. In MyKinsta, open your site, click the environment name at the top (for example Live), and choose Create new environment. Select Standard, click Continue, then choose Clone an Existing Environment and pick your live environment. Kinsta lets you push only files, only the database, or both back to live.
WP Engine. In the User Portal, go to the Sites page, click your site, then click Add environment next to the environment name. Enter a name, choose Staging as the environment type, and finish the setup. Each site gets separate production, staging, and development environments you can copy between.
SiteGround. SiteGround’s managed WordPress plans include a staging tool in Site Tools — create the copy, test, and push it back from the same screen.
WordPress.com. Staging is available on WordPress.com Business and Commerce plans. From your hosting dashboard, click the Production drop-down beneath your site title and select + Add staging site. The staging address is created automatically by prepending staging- plus four random characters to your production address, and WordPress.com adds WP_ENVIRONMENT_TYPE=staging to the copy’s wp-config.php for you.
One warning applies to every host tool: read the push-back screen before you click it. Pushing the staging database back to live overwrites the live database — including any orders, comments, or form entries that arrived while you were testing. Push files only unless you know production had zero writes. The sync rules later in this guide explain why.
Method 2: Clone it with the free WP Staging plugin
If your host has no staging tool, the WP Staging plugin — available in the WordPress.org plugin directory — clones your site into a subfolder such as example.com/staging-site, using a new table prefix in the same database. The free version does this one job well: it creates the clone. Pushing changes from staging back to live is a Pro feature, so with the free version you repeat tested changes on the live site by hand — which, for plugin updates, is what you should do anyway.
- Install the plugin. Go to Plugins → Add New, search for “WP Staging”, install it, and activate it.
- Create the staging site. Open WP Staging → Staging Sites and click Create New Staging Site. Give it a short name, such as
test. - Choose what to include. Under DB Tables and Files you can exclude individual tables and folders. Leave out large backup or cache folders — they only slow the clone down.
- Start the clone and wait. Keep the tab open until the plugin tells you the copy is ready, then open the staging link and log in.
Two things the plugin handles for you: only administrators can open the clone, and the clone is set up to stay out of search engines. The trade-off is honest — the clone shares the live database server and disk, so a huge site makes the copy slow and uses space. And if your site is on a host that keeps WordPress core files outside the web root (Flywheel or WordPress.com, for example), change the destination directory to ./wp-content/, which is always writable.
Method 3: Build it by hand with WP-CLI (the full-control method)
The manual method is the one to learn when you want to understand what staging actually is — and when no tool is available. You need SSH access and WP-CLI installed on the server. Every command below runs from the production site’s folder unless stated otherwise. Replace example.com and staging.example.com with your own domains.
Step 1 — Back up production before you write anything. Never skip this. A staging copy is a write operation on a live database.
mkdir -p ~/preprod-backups
wp db export ~/preprod-backups/before-staging.sql --single-transaction
tar -czf ~/preprod-backups/files-before-staging.tar.gz -C ~/public_html .
Step 2 — Create the subdomain and its folder. Create staging.example.com in your hosting panel and point it at a new folder, for example ~/staging.example.com. Use the same PHP version as production — a staging site on a newer PHP validates a configuration that is not your client’s.
Step 3 — Copy the files.
rsync -a --exclude='wp-content/cache/' ~/public_html/ ~/staging.example.com/
Step 4 — Create a dedicated database and user. In your host’s MySQL section, create a new database and a user, and give that user all privileges on the new database only. Then point the copy at it:
cd ~/staging.example.com
wp config set DB_NAME staging_wp
wp config set DB_USER staging_user
wp config set DB_PASSWORD 'change-me'
Step 5 — Import the database.
wp db import ~/preprod-backups/before-staging.sql
Step 6 — Replace the URLs, as a dry run first. WP-CLI’s search-replace handles PHP serialized data correctly, which is why you use it instead of a raw SQL REPLACE() — a raw replace corrupts serialized strings by changing their length without updating the length prefix. Always run with --dry-run first, and skip the guid column: GUIDs are permanent identifiers, not URLs, and rewriting them is a known way to break feeds.
wp search-replace 'https://example.com' 'https://staging.example.com' --all-tables --skip-columns=guid --dry-run
wp search-replace 'https://example.com' 'https://staging.example.com' --all-tables --skip-columns=guid
Step 7 — Tell WordPress this copy is staging. Add these lines to the copy’s wp-config.php, above the “stop editing” comment. WP_ENVIRONMENT_TYPE is the official constant — plugins and WordPress core itself read it to tell environments apart. Disabling WP-Cron stops the copy firing scheduled tasks against production data, and the debug constants send errors to a log instead of the screen. (If you want the full story on the debug constants, see our WordPress debug.log guide; the cron constant is explained in our guide to disabling WP-Cron.)
define( 'WP_ENVIRONMENT_TYPE', 'staging' );
define( 'DISABLE_WP_CRON', true );
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
Step 8 — Close access and ask search engines to stay away. Cover this in the safety checklist below — it is not optional, and it is the step people skip most.
Step 9 — Smoke-test the copy. Log in, open the homepage and a couple of inner pages, submit a test form, and check the admin bar. If the copy redirects you to the live domain, the search-replace missed a URL — usually a hardcoded one in wp-config.php (WP_HOME / WP_SITEURL) or in a plugin’s settings table.
Method 4: Run a local copy on your own computer
For design work and development, a local copy is often better than a server staging site: it is free, instant, and offline. Two tools cover most cases — Local by Flywheel and Studio by WordPress.com. Both are free to download, both spin up a full WordPress install in minutes, and both let you pull a live site down or push a local site up.
The trade-off is fidelity. A local copy runs your computer’s PHP version, not your server’s, and it cannot reproduce server-only behaviour — real cron, real mail delivery, your host’s caching layer. Use local for building, and a server staging site for the final test before anything goes live.
Make your staging site harmless: the safety checklist
A staging site that can send email, charge cards, or get indexed is not staging. It is a second production site with a worse name. Run through this checklist the moment the copy exists — before you test anything.
1. Keep it out of Google. In the staging dashboard go to Settings → Reading and tick Discourage search engines from indexing this site. That sets a noindex flag WordPress sends to crawlers. The WP Staging plugin handles this for its clones automatically; host tools and manual copies need you to do it by hand. Note that noindex is a request, not a wall — which is why the next step matters more.
2. Lock the door. Put the staging site behind a password. On Apache, drop an .htaccess password prompt in the staging folder; on Nginx, add an auth_basic block; or use a maintenance/coming-soon plugin that requires login. A password stops crawlers, scrapers, and curious visitors far more reliably than a noindex tag. The WP Staging plugin already restricts its clones to logged-in administrators, which covers this for that method.
3. Stop it sending real email. A staging site restored from production will eventually email real customers — a test order confirmation, a password reset pointing at staging.example.com. This is the single highest-value line in the whole checklist. Either install a plugin that disables outgoing mail (search “disable emails” in Plugins → Add New), or add a must-use plugin with one filter:
<?php
// wp-content/mu-plugins/disable-mail-on-staging.php
add_filter( 'pre_wp_mail', '__return_false' );
4. Disable scheduled tasks. If you used the manual method you already set DISABLE_WP_CRON in wp-config.php. For host-tool and plugin copies, add the same line to the staging copy’s wp-config.php. Staging should never fire a scheduled newsletter, membership renewal, or subscription charge.
5. Disconnect payments and analytics. Switch payment gateways to test mode (Stripe test keys, PayPal sandbox), and remove or pause analytics and tracking pixels. A staging checkout that charges a real card is a support ticket waiting to happen, and staging pageviews pollute your real analytics.
6. Match production’s PHP version. Test on the same PHP version your live site runs. Testing on a newer PHP proves nothing about the configuration your visitors actually use — and testing on an older one hides failures you will meet on upgrade day.
How to push staging changes back to live without losing data
This is where staging sites cause real damage. Files and the database are two different things, and they travel by different rules. Write this rule down before you copy anything:
Content a human wrote and code a human reviewed may travel. Session state, credentials, environment identity, and anything a customer typed may not.
| Data | Staging → production | Production → staging |
|---|---|---|
| Theme and plugin files | Yes — this is the normal push | Yes — refresh the copy |
| Plugin and theme settings | Yes, carefully — settings live in the database, so push them selectively | Yes |
| Pages and posts you edited | Yes — one item at a time | Yes |
| Orders, comments, form entries | Never — these only exist on production | Never — staging must not see real customer data |
| Users and passwords | Never | Never — use a test admin account on staging |
| API keys and payment credentials | Never — staging holds test keys only | Never |
Recipe A — code-only push (the default). This covers 90% of staging work: a plugin update, a theme edit, a new template. Push the changed files only — via your host’s “push files only” option, via Git, or by copying the changed theme/plugin folder. Touch nothing in the database. Re-apply any settings change on live by hand, from a note you made while testing.
Recipe B — push one page’s content. You redesigned a landing page on staging and want it live. Export that single page (Tools → Export, or your page builder’s export), import it on production, and check the result. Never push the whole database to move one page.
Recipe C — full database push, only when production had zero writes. The only safe moment for a full database push is when nothing changed on production while you were testing — no orders, no comments, no new users, no form entries. For a brochure site over a quiet weekend, that is often true. For a WooCommerce store, it is almost never true. If you are unsure, you do not have zero writes: use Recipe A or B instead.
When in doubt, the safe order is: refresh staging from production, test again, then push files only. It takes ten extra minutes and it has never lost anyone an order.
5 mistakes that turn staging into a second production site
1. Pushing the whole database back to live. The classic disaster. Your staging database is a snapshot from the day you cloned it. Pushing it overwrites every order, comment, and registration that arrived since. Push files, not the database — unless you have verified zero writes on production.
2. Letting staging send email. Covered above, but it bears repeating because it is the mistake with the most embarrassing consequences: a customer receives a password reset or an order confirmation from staging.example.com and assumes your site has been hacked.
3. Forgetting the noindex step. An unprotected staging site gets crawled, and Google may show your staging URLs — or worse, treat the staging copy as duplicate content and split your ranking between the two. Password protection plus noindex together close this properly.
4. Testing on a different PHP version. Staging on PHP 8.4 while production runs 8.2 tells you nothing about the upgrade you are actually planning, and it hides deprecation warnings that will appear the day you switch. Match the versions.
5. Letting staging go stale. A staging copy from three months ago is not a test of your current site — it is a test of an old one. Refresh it from production before any serious test, especially before a major update. If your host’s tool offers a one-click re-clone, use it every time.
Staging is a habit, not a project
You do not need a staging workflow with a runbook and a change-approval board. You need a copy of your site you can break without consequences, a checklist that keeps it harmless, and the discipline to push files — never a whole database — back to live. Set it up once, refresh it before every big update, and the white-screen-of-death update becomes a story you tell other people instead of a day you lose.
Start with the easiest method your host allows. If that is a one-click tool, you can have a staging site running in the next ten minutes.
Further Reading & References
- Create a Staging Site in WordPress — WordPress.com Support — the official WordPress.com staging guide, including Business and Commerce plan availability.
- How to Create a WordPress Staging Site (4 Proven Methods) — Jetpack — host tools, plugins, local environments, and manual setup compared.
- How to Create a WordPress Staging Site (4 Ways) — HowToWP — a fresh, detailed walkthrough of all four methods including Kinsta and WP Engine steps.
- wp search-replace — WP-CLI Command — Developer.WordPress.org — the official reference for the URL-replacement command, including
--skip-columns=guidand--dry-run. - wp-config.php: WP_ENVIRONMENT_TYPE — Developer.WordPress.org — the official documentation for the environment-type constant.
- WP STAGING — WordPress.org plugin directory — the free plugin’s feature list: subfolder cloning, admin-only access, and no-index handling.
- How to Create a WordPress Staging Site — WP Staging — the plugin author’s own guide to one-click subfolder clones and what the free version covers.
- How to Build a WordPress Staging Site and Sync Data Safely — DEV Community — the sync matrix and the “what never travels back” rule, from a WordPress agency’s production practice.
On this blog: WordPress Debug.log: How to Enable It and Read What It Tells You, WordPress Cron Is Fake: How to Disable WP-Cron and Set Up Real Cron, and How to Move WordPress to a New Host Without Downtime.


