Title: Axle Staging Guard
Author: Aryan Jasala
Published: <strong>November 6, 2026</strong>
Last modified: November 6, 2026

---

Search plugins

![](https://ps.w.org/axle-staging-guard/assets/banner-772x250.png?rev=3787378)

![](https://ps.w.org/axle-staging-guard/assets/icon-256x256.png?rev=3787378)

# Axle Staging Guard

 By [Aryan Jasala](https://profiles.wordpress.org/aryanjasala/)

[Download](https://downloads.wordpress.org/plugin/axle-staging-guard.2.0.0.zip)

 * [Details](https://wordpress.org/plugins/axle-staging-guard/#description)
 * [Reviews](https://wordpress.org/plugins/axle-staging-guard/#reviews)
 * [Development](https://wordpress.org/plugins/axle-staging-guard/#developers)

 [Support](https://wordpress.org/support/plugin/axle-staging-guard/)

## Description

Every agency has a staging story. A copy of the live database goes to staging, and
then:

 * a scheduled task emails every customer from the staging site,
 * Google indexes staging.example.com and it outranks the real site,
 * someone spends an hour editing staging, thinking it was live.

Axle Staging Guard prevents all three, on every copy that is not the live site.

**On staging, development and local copies it:**

 * Blocks all outgoing email, or sends it all to one test address with the real 
   recipients shown in the subject. Cc and Bcc recipients are removed too.
 * Lets your own team keep receiving email: list addresses or whole domains (@youragency.
   com) under “Always deliver to”.
 * Keeps a list of the last 50 stopped emails (recipient, subject and time), so 
   you can see what would have gone out. Turn on “keep message bodies” to check 
   email content as well.
 * Sends a test email from the settings screen, so you can see exactly what happens
   to email from this copy.
 * Hides the site from search engines with an `X-Robots-Tag` header, a `noindex,
   nofollow` robots meta tag and a robots.txt that blocks everything, and turns 
   off the XML sitemap.
 * Colours the whole admin bar (orange for staging, blue for development, green 
   for local) and labels it, on the dashboard and on the front end.
 * Adds the environment to every browser tab title, for example “[Staging] Posts”,
   so the right tab is easy to find.
 * Adds a Site Health check that warns when email from a staging copy could still
   reach real people, or when staging copies of the live site would not be detected.

**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 plugins for running WordPress sites safely.

#### How it knows which copy is live

 1. If `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.
 2. Otherwise, use the **production lock**: on the live site, go to Tools > Axle Staging
    Guard and click “This is the live site”. From then on, any copy of the database
    running on a different domain is treated as staging, with no wp-config.php change.

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.

#### Settings in wp-config.php

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', 'qa@example.com' );
    define( 'AXLE_STAGING_GUARD_ALLOWLIST', '@youragency.com, client@example.com' );
    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-CLI

 * `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 you@example.com` sends a test email and reports
   what happened to it.

**Try it before you install.** [try.axlewp.com/axle-staging-guard](https://try.axlewp.com/axle-staging-guard)
opens a private WordPress in your browser with this plugin and some demo content.

Part of [Axle](https://axlewp.com/), a family of free plugins for running WordPress
sites safely.

## Screenshots

[⌊The coloured admin bar on a staging copy.⌉⌊The coloured admin bar on a staging
copy.⌉[

The coloured admin bar on a staging copy.

[⌊Tools > Axle Staging Guard with the email log.⌉⌊Tools > Axle Staging Guard with
the email log.⌉[

Tools > Axle Staging Guard with the email log.

## FAQ

### Does it work with SMTP plugins?

Yes, for plugins that send through WordPress’s own `wp_mail()` function, which is
most of them. A few plugins replace `wp_mail()` entirely. Axle Staging Guard detects
this and shows a warning on its settings screen, because it cannot intercept those
emails.

### Will blocked emails break password resets on staging?

No. Blocked emails are reported to WordPress as sent, so forms and password resets
behave normally. Use redirect mode if you need to receive them.

### What if I copy the staging database to production?

The production lock is still stored, and the live domain still matches it, so the
live site stays unguarded. The search engine setting under Settings > Reading is
never changed by this plugin.

### Can I change how the environment is detected?

Use the `axle_staging_guard_environment` filter. It receives an array with `type`(
production, staging, development or local) and `source`.

### What if the live site moves to a new domain?

Then the production lock no longer matches, and the live site would count as staging.
Axle Staging Guard warns about this on every admin screen and in Site Health, so
it does not go unnoticed. Lock the new domain from Tools > Axle Staging Guard, or
list every live domain in `AXLE_STAGING_GUARD_PRODUCTION_HOSTS` so a move never 
trips it. `www.` and the bare domain already count as the same.

### Does the email log keep personal data?

It keeps who an email was for and its subject, and the message only if you turn 
that on. Entries are deleted after 7 days, and the log is part of the WordPress 
export and erase personal data tools. The live site keeps no log.

## Reviews

There are no reviews for this plugin.

## Contributors & Developers

“Axle Staging Guard” is open source software. The following people have contributed
to this plugin.

Contributors

 *   [ Aryan Jasala ](https://profiles.wordpress.org/aryanjasala/)

[Translate “Axle Staging Guard” into your language.](https://translate.wordpress.org/projects/wp-plugins/axle-staging-guard)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/axle-staging-guard/),
check out the [SVN repository](https://plugins.svn.wordpress.org/axle-staging-guard/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/axle-staging-guard/)
by [RSS](https://plugins.trac.wordpress.org/log/axle-staging-guard/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 2.0.0

 * Changed (breaking change): rename to Axle Staging Guard for WordPress.org

#### 1.3.0

 * Fix: make the abilities visible to MCP agents
 * New: add abilities so AI agents can tell staging from the live site before doing
   anything risky

#### 1.2.0

 * New: add filters for email handling, robots.txt, colours and labels, and actions
   for the production lock
 * Fix: warn when the live site counts as staging, and move the email log out of
   one option

#### 1.1.0

 * New: “Always deliver to” allowlist for addresses and @domains.
 * New: send a test email from the settings screen or WP-CLI.
 * New: optionally keep message bodies in the email log.
 * New: Site Health check.
 * New: environment shown in browser tab titles.
 * New: redesigned settings screen with status cards.
 * Rewritten as PSR-4 classes.

#### 1.0.0

 * First release.

## Meta

 *  Version **2.0.0**
 *  Last updated **1 day ago**
 *  Active installations **Fewer than 10**
 *  WordPress version ** 6.6 or higher **
 *  Tested up to **7.1.4**
 *  PHP version ** 7.4 or higher **
 * Tags
 * [development](https://wordpress.org/plugins/tags/development/)[email](https://wordpress.org/plugins/tags/email/)
   [environment](https://wordpress.org/plugins/tags/environment/)[noindex](https://wordpress.org/plugins/tags/noindex/)
   [staging](https://wordpress.org/plugins/tags/staging/)
 *  [Advanced View](https://wordpress.org/plugins/axle-staging-guard/advanced/)

## Ratings

No reviews have been submitted yet.

[Your review](https://wordpress.org/support/plugin/axle-staging-guard/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/axle-staging-guard/reviews/)

## Contributors

 *   [ Aryan Jasala ](https://profiles.wordpress.org/aryanjasala/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/axle-staging-guard/)