All articles

Websites · 12 November 2026 · 4 min read

WordPress staging done right: test updates without breaking the live site

Most broken WordPress sites we are asked to rescue were not hacked. They were updated: a plugin update on a Friday afternoon, a PHP version change by the host, a theme update that wiped custom code. A staging site, a private copy where you test changes first, prevents most of these incidents. But a careless staging site creates its own problems: customers receiving test emails, Google indexing a duplicate site, or new orders lost when staging is pushed back to live.

What a staging site is

Staging is a copy of the production site: same WordPress version, same theme and plugins, same PHP version, and a recent copy of the database and uploads, running on a separate address such as staging.example.com. It should be as close to production as possible. A staging site on PHP 8.3 tells you nothing about a production server on PHP 8.1.

Creating it safely

  1. Copy files and database from production. Many hosts offer one-click staging; otherwise use WP-CLI to export the database and copy wp-content.
  2. Replace URLs properly. WordPress stores serialized data, so a plain text search-and-replace in an SQL dump corrupts settings. Use WP-CLI:
    wp search-replace 'https://example.com' 'https://staging.example.com' --all-tables --precise
    wp config set WP_ENVIRONMENT_TYPE staging
  3. Protect it with HTTP authentication at the web server level. A noindex setting alone is not enough, and a staging site with a forgotten admin password is an easy target.
  4. Stop outgoing email. Install a mail-catching plugin or route SMTP to a test inbox. Otherwise WooCommerce, membership and form plugins will send real messages to real customers from staging.
  5. Disable integrations that act on the outside world: payment gateways in live mode, CRM sync, newsletter sync, webhooks, scheduled exports. Switch payments to test mode.
  6. Use separate credentials for the staging database and remove personal data if the copy goes to a third party.

WP_ENVIRONMENT_TYPE lets plugins and your own code behave differently on staging, for example to switch off analytics and caching services.

The database problem nobody warns you about

Code flows from staging to production. Content and data flow the other way. While you test on staging, the live site keeps receiving orders, form submissions, comments, new users and posts. If you push the staging database back to production, all of that is overwritten.

So the rule is:

A repeatable update routine

  1. Refresh staging from production (files and database), then re-apply the staging safety settings.
  2. Read the changelogs of major plugin and theme updates. Note anything that says “breaking”, “database migration” or “requires PHP”.
  3. Update on staging: WordPress core first, then plugins, then the theme.
  4. Test the critical paths, not just the home page: contact and quote forms, checkout with a test payment, login and registration, search, the pages that bring most of your traffic, and the admin pages editors use daily.
  5. Check the PHP error log and the browser console for new warnings.
  6. Take a fresh backup of production, then apply the same updates there, in the same order, at a quiet hour.
  7. Repeat the critical-path test on production and keep the backup until the next cycle.

Automating the boring parts

Security updates are the exception

When a plugin has an actively exploited vulnerability, waiting a week for a staging cycle can be worse than the risk of a broken layout. For critical security fixes, back up, update production immediately, test the critical paths and fix any fallout afterwards. Our patch management guide explains how to tell the difference.

Our take

Every business site that takes orders, leads or bookings should have a staging copy and an update routine. The routine matters more than the tooling: refresh from production, test the paths that make money, back up, then update production. And treat the database as one-way traffic. The worst staging incident we see is not a broken plugin, it is a day of lost orders after someone pushed staging back to live.

Want this handled for you?

Staging, tested updates and backups are part of our website plans; our maintenance checklist shows the full routine. Check your site with the website check, or see pricing.

More articles

IT management · 3 min readIn-house IT or managed IT services: an honest cost comparison for 10–50 person companiesWhat an internal IT administrator really costs compared with a managed IT service, what you gain and lose with each option, and when a hybrid model works best.Read the articleIT management · 3 min readHow much does IT downtime cost your business? RTO, RPO and a simple calculationHow to estimate what an hour of IT downtime costs a small business, what RTO and RPO mean, and how to use the numbers to decide how much to spend on backups, redundancy and support.Read the articleInfrastructure · 5 min readVLANs for a small office: how to separate staff, guests, phones and cameras properlyA practical VLAN plan for offices of 10 to 100 people: which segments you need, how traffic between them should be filtered, voice VLAN and QoS, and the mistakes that make segmentation useless.Read the article