A staging environment is a copy of your site on which a change is tested before being applied to the real one. The idea is simple, and often presented as obvious. In practice, staging has a cost, calls for discipline and can create problems of its own: emails sent to real customers, a test page indexed by Google, orders overwritten at deployment. The right question is therefore not “do I need staging?”, but “at what point does the risk of testing directly in production become too high?”.

Development, staging, production: three different roles
These terms often get mixed up. Yet they name environments with quite distinct uses, and it is the separation between them that protects the real site.
A small site can do without the development environment. Staging, for its part, is only worth anything if it really does resemble production.
WordPress knows which environment it is running in. Since version 5.5, the wp_get_environment_type() function returns one of the values local, development, staging or production, set by the WP_ENVIRONMENT_TYPE in wp-config.php or by a server environment variable. With nothing set, the value is production. Declaring staging on the copy lets plugins that take it into account adapt their behaviour, for instance by disabling emails or connections to external services: that is useful, but do not assume all your plugins do it.
define( 'WP_ENVIRONMENT_TYPE', 'staging' );
When staging becomes necessary
The need does not depend on the size of the site, but on two things: what an outage would cost, and how likely a change is to break something without anyone noticing straight away. A brochure site showing a blank page is seen immediately; a shop whose order emails stop going out can look fine for days, as WooCommerce order emails not received.
Staging according to the type of site
| Situation | Risk of testing in production | Verdict |
|---|---|---|
| Brochure site, few plugins, regular updates | Low: an outage is seen at once, and restoring is simple | A backup and a check are often enough |
| Brochure site with a bespoke theme or a complex builder | Moderate: the display breaks on some pages only | A one-off copy for the bigger changes |
| WooCommerce shop | High: basket, payment, emails and stock can break with no visible sign | Essential before any significant change |
| Members' area, booking, training | High: signed-in journeys are hard to check by eye | Advisable to essential |
| Business application, connectors, custom code | High: no publisher has tested your combination | Essential |
The changes that warrant a test outside production
Theme, builder, redesign
A visual or structural change, new URLs, new templates.
Payment, connectors, code
A new gateway, synchronisation with an ERP or a CRM, bespoke development.
For a minor update to a well-maintained plugin on a simple site, the method described in WordPress stopped working after an update (backup, small batches, a check) remains proportionate. Staging is not a compulsory step before every click on “Update”.
Protecting and isolating the copy
A staging site is a complete copy of the site, often reachable on the internet. Badly protected, it becomes a problem in its own right: duplicate content in Google, customer data exposed, real emails sent out.
A faithful copy, or the test proves nothing
Staging is only worth anything if it behaves like production. The commonest differences are also the most misleading: a different PHP version, plugins disabled “to make it quicker”, an empty or old database, no cache when one is active live. The test passes, and then the deployment fails on whatever was not reproduced.
- The same PHP, database and WordPress versions as production.
- The same plugins and the same theme, in the same versions, before applying the change under test.
- Recent data: a copy refreshed just before the test, not a database several months old.
- The same caching logic and, where possible, the same memory and execution-time limits.
The copy can live on a subdomain of the same hosting, on a separate server or on a local machine. The subdomain is the simplest for having a non-technical person sign things off; it does, on the other hand, call for the protection described below and for enough resources not to slow the real site down during the tests.
Who tests what
A technical test checks that the pages load, that the logs show no error and that the scheduled tasks run. It does not check that the right price applies, that the quote form reaches the right person or that the legal text is up to date. Plan a short list of journeys for whoever knows the business to validate, and write the result down: that is what turns a test copy into a real validation step.
A password rather than a bare “noindex”
WordPress's “Discourage search engines from indexing this site” checkbox is only a request to the robots: the copy stays readable by anyone who knows or guesses the address, and that request does not remove a page already found. Authentication at the server level (a username and password asked for before anything is displayed) blocks both visitors and robots. The opposite danger exists too: a no-index setting copied to production by mistake makes the site disappear from the results, as a noindex tag after a redesign.
Personal data
Copying the production database means copying the customer accounts, addresses, orders and form messages. That data is still covered by the GDPR on the copy: access limited to the people who need it, the copy deleted when it is no longer in use, and data reduced or anonymised as far as possible when the tests do not need the real information.
Cutting off anything that goes outside
- Email : intercept or disable sending, or a test order or a scheduled task will write to real customers.
- Scheduled tasks : reminders, synchronisations and scheduled exports run on the copy too, see WP-Cron and scheduled tasks.
- Connectors : ERP, CRM, logistics and webhooks have to point at test environments, or be cut off.
- Analytics and advertising : remove or isolate the tracking tags so as not to distort the measurements.
WooCommerce, payments and subscriptions
A shop is where staging protects you most, and where it calls for the most care. Payment gateways generally offer a test mode, with separate credentials: on the copy, only those test keys should be active, so that a complete order can be placed without a real charge.
The WooCommerce Subscriptions plugin offers an example of a built-in safeguard: it records the address of the site it was activated on. When the site runs under another address, such as a test copy, it switches to staging mode and no longer takes the automatic renewal payments or sends the emails tied to subscriptions. The documentation also sets out how to leave that mode: it is a step to take knowingly, and never on the copy.
The whole journey
Adding to the basket, shipping, payment in test mode, confirmation, email, stock, invoice. The typical errors are described in payment error after a WooCommerce update.
Overwriting the shop with the copy
Between the moment of the copy and the deployment, orders, customers and stock have changed in production. Replacing them with the test database makes them disappear.
Synchronising and going live
The rule that avoids most accidents fits in one sentence: content goes down, code goes up. Live data (orders, accounts, published posts, messages) is born in production and is copied down to staging so you can test against a realistic database. Changes to code and configuration (theme, plugins, settings) are validated in staging and then applied to production.
- BackupA complete, dated copy of production, with the restore possible.
- StagingStaging refreshed from production, protected, sending cut off.
- TestsThe change is applied, then the important journeys are checked.
- ValidationWhoever knows the site's business confirms that everything works.
- ProductionThe same change is applied to the real site, in a quiet slot.
- CheckCritical journeys, error logs and scheduled tasks checked straight afterwards.
The change is replayed in production. The staging database is not copied over the real site, except for a site with no live content, and after checking.
Copying production to the staging site means replacing the site's address in the database, respecting the serialised data: a tool like WP-CLI's wp search-replace command does it correctly. After going live, check the canonical addresses and the sitemap too, two things that easily keep a trace of the copy: see canonical errors after a migration and an incorrect sitemap after a redesign.
Planning the rollback before you start
Staging reduces the risk, it does not cancel it: production has other visitors, other data and sometimes a slightly different configuration. Before every deployment, decide in advance what will trigger a rollback and how it will be done.
Going back, according to what changed
| Change | How to go back | Watch out |
|---|---|---|
| A plugin or theme update | Reinstall the previous version of the files | Some updates change the database |
| A change of PHP version | Go back to the previous version on the hosting side | Quick, as long as the version is still available |
| An update with a database migration | Restore the database backup | Orders placed since would be lost: handle those separately |
| A redesign or a new theme | Re-activate the old theme or restore the files | Redirects and SEO settings to check |
If a component blocks the site after going live, the approach in a WordPress plugin blocking the site and the one in WordPress stuck in maintenance mode let you restore access before restoring anything else. A backup is only worth something if its restore has already been tested: that is the point of our backups.
Staging is not there to prove that everything will go well. It is there to find out what will go wrong while it is still without consequence.
Do I need staging?
Nine questions about your site and the way you change it. The result says whether staging is superfluous, advisable or essential, with the workflow that suits.
Want to know which method suits your site?
Talk to us about itThe limits of staging on a small site
For a brochure site of a few pages, permanent staging has a cost that often exceeds the risk it covers: it has to be kept up to date, protected and refreshed, and it ages quickly if nobody uses it. A copy six months old no longer tests very much.
A checked backup + a check
A full backup before the work, updates in small batches, the pages and the form checked straight afterwards.
A temporary test copy
Created for a heavy change (a redesign, a PHP version, a new theme), then deleted once it is signed off.
Health Check's troubleshooting mode
Disables the plugins for your admin session alone, without affecting visitors. Useful for isolating a cause, not for signing off a redesign.
A ghost staging site
An old copy, never refreshed, publicly reachable: more risk than benefit.
What matters is having a repeatable method: who does the work, when, with which backup and which check. For a simple site, delegating that routine to maintenance with a backup beforehand is often more use than an extra environment.
The mistakes to avoid
Leaving the copy public
Duplicate content, personal data on view, and the risk of its being mistaken for the real site.
Forgetting outbound email
Customers receive confirmations of test orders, or duplicate reminders.
Copying the test database to production
Orders, sign-ups and content published in the meantime disappear.
Testing on a copy that does not resemble production
A different PHP version, different plugins, empty data: the test proves nothing.
Keeping the real payment keys
A test order can then trigger a real charge.
Signing off without the business side
The technician sees that the page loads; the owner sees that the price or the shipping is wrong.
For a migration, the logic is the same on a larger scale: the new installation is checked before the domain is switched over. That is what our hosting migration.
Frequently asked questions about WordPress staging
What is the difference between staging and a preproduction site?
None: staging is the English term for preproduction, a copy of the real site on which changes are validated before being applied to production.
Does a brochure site need staging?
Rarely on a permanent basis. A checked backup before every piece of work and a check afterwards are enough in most cases, with a temporary copy for a redesign or a significant version change.
How do I stop Google indexing the staging site?
Protect it with a username and password at the server level. WordPress's no-index checkbox is merely a request to the robots and leaves the copy reachable by anyone.
Can I copy the staging site over the live site?
For files and settings that have been signed off, yes. For the database of a live site such as a shop, no: the orders and accounts created in the meantime would be wiped. The change that was signed off is replayed in production.
What is WP_ENVIRONMENT_TYPE for?
This constant tells WordPress and the plugins which environment they are running in: local, development, staging or production. With nothing set, WordPress assumes it is in production.
Does Host by French provide a staging site?
A validation copy is always prepared before a migration. Permanent staging is considered project by project, according to the type of site and how often it changes.
Staging is justified by what a mistake would cost, not on principle
A simple brochure site: a backup, small batches and a check. A shop, a members' area or bespoke code: test outside production before every significant change, with a protected copy, outbound email cut off and a rollback ready.
See how we back upSummary with an AI
Choose your assistant: the request is prefilled where that is possible, and always copied, ready to paste if need be.

































🍪