A staging site makes testing updates easier—but copying your live site can also bring along customer emails, payment credentials, and background automations. Without safeguards, your tests can reach real customers.
Start by identifying the environment. Add this line to your staging site’s wp-config.php, above the “That’s all, stop editing!” comment:
define( 'WP_ENVIRONMENT_TYPE', 'staging' );
If WP_ENVIRONMENT_TYPE is already defined, change its value to 'staging' instead of adding another definition.
This tells WordPress and compatible plugins that the site is staging. Because it’s stored in a file rather than the database, it survives database refreshes from your live site. Alok Jain’s article explains the approach.
That line alone won’t stop outgoing emails or payments. Pair it with a few safeguards:
- Block customer emails or redirect them to a test inbox.
- Use test payment credentials and review connected services.
- Pause background automations unless you’re testing them.
- Restrict access and keep staging out of search results.
For email specifically, Jain shares a small must-use plugin that blocks messages sent through WordPress outside production. Plugins that send directly through an email service’s API need separate controls.
Prefer a ready-made option? Staging Superpowers recognizes the staging setting and bundles protections for email, connected services, scheduled tasks, indexing, and more.
After each refresh, verify your safeguards with a test form submission or order. A staging site should give you room to experiment without surprising your customers.

Just wrapped up migrating nearly 20 WordPress sites from a customer’s fleet onto our new PressHarbor platform, built on Automattic’s WP Cloud infrastructure.
One thing stood out:
Long-running WordPress sites carry a lot of history. The good and the bad.
One of the things I enjoy seeing during a well-executed migration is that history being preserved.
When a migration is performed using tools like rsync, file modification timestamps can be preserved along with the files themselves. It’s surprisingly satisfying to see an image uploaded in 2014 still showing a 2014 modification date after arriving on the new platform.
But history isn’t just found in file timestamps.
It’s also found in the plugin list.
Many of these sites carried image optimization plugins, CDN plugins, caching plugins, and various performance tools that solved very real problems when they were installed.
Those choices weren’t mistakes. In many cases they were exactly the right solution at the time.
But platforms evolve. WordPress evolves.
Today we’re running on a platform with a built-in CDN, integrated edge caching, image optimization, and dynamic image resizing capabilities that simply weren’t available when many of these sites were first optimized.
It raises an interesting question:
How many of the optimizations on a site are still solving today’s problems, and how many are solving yesterday’s?
Sometimes the best optimization isn’t adding another plugin.
It’s removing the ones you no longer need.