WordPress Staging Site: How to Test Changes Before They Go Live

Drafts and previews cover new content. For updates, new plugins or a redesign you need a WordPress staging site: a copy of your site where mistakes affect no one.

Editing without publishing: what WordPress already does

Many changes do not need a second installation:

  • Drafts: save new pages and posts as drafts and use Preview. Visitors see nothing.
  • Scheduling: pick a publish date and time in the publish panel.
  • Revisions: restore earlier versions of a page from its revision history.
  • Reworking a live page: duplicate it, edit the copy as a draft, then move the content over. Edits to a published page are otherwise visible the moment you save.

Once a change touches updates, plugins, the theme or settings, it affects the whole site. That is what staging is for.

Three ways to get a WordPress staging site

MethodBest forWatch out for
Your host's staging toolMost business sitesNot on every plan. Check whether push-to-live lets you choose files and database separately.
A plugin such as WP STAGINGHosting without built-in stagingThe copy lives on the same hosting account; pushing back to live is a paid feature.
Manual with WP-CLIAnyone with SSH and database accessFull control, more manual steps and room for error

What to check in your host's staging tool

  • Selective push: can you push files and database separately, or only everything at once?
  • Same environment: does the copy run the same PHP version and server settings?
  • Protection: is the staging URL password protected and excluded from indexing by default?
  • Refresh: can you rebuild the copy from live in one step?

If the documentation does not say, ask your host before relying on it.

Manual setup with WP-CLI

You need a subdomain such as staging.yourdomain.com, an empty database and SSH access.

# on the live site
wp db export live.sql
# copy files to /path/to/staging, then there:
wp config set DB_NAME staging_db
wp db import live.sql
wp search-replace 'https://yourdomain.com' 'https://staging.yourdomain.com' --all-tables --precise
wp config set WP_ENVIRONMENT_TYPE staging
wp option update blog_public 0

wp search-replace also handles serialized data, which a plain find-and-replace in the SQL file breaks. Run it with --dry-run first.

Locking down the staging site

  1. Restrict access: server-level password protection (your host's directory protection or HTTP authentication). It keeps out visitors and crawlers alike.
  2. Discourage indexing: Settings → Reading, tick "Discourage search engines". It is a request, not protection, so use it on top of step 1.
  3. Label the environment: set WP_ENVIRONMENT_TYPE to staging. Some plugins change behavior based on it, for example for email or license checks.
  4. Stop outgoing email: otherwise real customers get messages from the test copy. Use a plugin that blocks or captures mail.
  5. Switch payments to test mode: on stores, replace live gateway keys with test keys.
  6. Check scheduled jobs: newsletters and syncs with a CRM or inventory system must not run from two sites.

A staging site open to indexing creates duplicate content on a second hostname. After setup, confirm wp option get blog_public returns 0 and test the password prompt in a private browser window.

An update test on staging, step by step

  1. Refresh the staging copy from live so both match.
  2. Apply updates in exactly the order you will use on live, and test any planned PHP version change at the same time.
  3. Click through the critical paths: homepage, contact form, checkout or booking, dashboard login.
  4. Check the error log; WP_DEBUG_LOG is fine on staging as long as the site is protected.
  5. Write down what you tested, which versions, what broke and what to do on live.
wp plugin update --all
wp theme update --all
wp core update
wp core verify-checksums

Pushing changes live

The key question: what has changed on the live site since you made the copy?

  • Only tested updates: push nothing. Take a backup and run the same updates on live; see WordPress updates.
  • Theme or code changes: deploy only the changed files, ideally from version control.
  • Settings and content: recreate them on live or export and import them selectively.
  • Full redesign: put the live site in maintenance mode briefly, freeze content, then switch.

Before any push, take a fresh backup of the live site so you can roll back.

Alternative: a local copy on your own machine

For theme development or larger rebuilds, a local copy is often faster than staging at your host. Tools such as Local, DDEV or the WordPress project's own wp-env run a full installation on your computer. wp-env requires Docker:

npm -g install @wordpress/env
wp-env start

For the final check before launch, a staging site on your host is still worth it: only there do server configuration, PHP version and caching match production.

Common mistakes

  • Overwriting the live database with staging and wiping out recent orders or inquiries.
  • Leaving an old staging copy around for months. It gets no updates and becomes a way in.
  • Testing on a different PHP version than production. Staging should mirror live.
  • Replacing URLs in the database but forgetting hard-coded URLs in wp-config.php.

Moving to a new server follows very similar steps; see WordPress migration.

How eCloud Systems can help

If you want a staging environment set up, we can do it on request. For ongoing care of updates and changes, maintenance is available for a monthly fee. Contact us.

Frequently asked questions

Do I need staging for every change?

No. Edit text and images as drafts and check them in preview. Staging pays off for updates, new plugins, theme changes and anything that affects the whole site.

Can Google find my staging site?

Yes, if it is publicly reachable. Protect it with server-level password protection, and also enable the option that discourages search engines.

Can I copy the staging database over the live site?

Only if nothing has happened on the live site in the meantime. Otherwise orders, form entries, comments or new users get overwritten. Moving changes selectively is usually safer.

Need a new WordPress website for a fixed price?

Up to 5 pages, mobile-ready, SEO basics, live in about 10 working days: €500 one-time, with a 30-day money-back guarantee. For help with an existing site, get in touch.