

The coloured admin bar on a staging copy.
Every agency has a staging story. A copy of the live database goes to staging, and then:
A fourth one is quieter: the copy keeps talking to your payment gateway, CRM, Mailchimp list or Zapier webhooks with the live keys it inherited.
Axle Staging Guard prevents all four, on every copy that is not the live site.
On staging, development and local copies it:
*.example.com.X-Robots-Tag header, a noindex, nofollow robots meta tag and a robots.txt that blocks everything, and turns off the XML sitemap.On the live site it does nothing.
Free and open source under the GPL. No pro version, no upsells, no ads in wp-admin, no tracking. And it stays that way.
Part of Axle by AryanX, a family of free plugins for running WordPress sites safely.
WP_ENVIRONMENT_TYPE is set in wp-config.php or in the server environment, it uses that. This is the WordPress standard, and many hosts set it for you.The lock stores a hash of the live domain instead of the domain itself. Migration tools that search and replace the domain name in the database leave the hash alone, so the lock survives the copy to staging.
If neither is set, WordPress assumes production and Axle Staging Guard stays off.
Fix the email behaviour per environment, so a database copy cannot change it:
define( 'AXLE_STAGING_GUARD_MAIL_MODE', 'redirect' ); // block, redirect or allow
define( 'AXLE_STAGING_GUARD_REDIRECT_TO', '[email protected]' );
define( 'AXLE_STAGING_GUARD_ALLOWLIST', '@youragency.com, [email protected]' );
define( 'AXLE_STAGING_GUARD_HTTP_MODE', 'block' ); // allow, log or block
define( 'AXLE_STAGING_GUARD_HTTP_ALLOWED_HOSTS', 'sandbox.paypal.com, *.youragency.com' );
define( 'AXLE_STAGING_GUARD_HTTP_BLOCKED_HOSTS', 'hooks.slack.com' ); // always blocked, in every mode
define( 'AXLE_STAGING_GUARD_PRODUCTION_HOSTS', 'example.com, shop.example.com' ); // the live domains
define( 'AXLE_STAGING_GUARD_KEEP_BODIES', false );
define( 'AXLE_STAGING_GUARD_NOINDEX', true );
define( 'AXLE_STAGING_GUARD_LOG_DAYS', 7 );
wp axle-staging-guard status shows the environment, how it was detected, and what is guarded.wp axle-staging-guard lock-production marks the current domain as the live site.wp axle-staging-guard unlock-production removes the lock.wp axle-staging-guard log lists stopped email.wp axle-staging-guard test-email [email protected] sends a test email and reports what happened to it.wp axle-staging-guard http-log lists blocked and logged outgoing requests.wp axle-staging-guard test-url https://api.example.com/v1 says what would happen to a request to that URL.Try it before you install. try.axlewp.com/axle-staging-guard opens a private WordPress in your browser with this plugin and some demo content.