Black Friday 40% off yearly and lifetime plans · 18d left Ends in 18d09h23m Claim 40% off
Security38 docs

How to Show the Staging Environment Indicator in WordPress

Show a visible staging environment indicator in the WordPress admin. Reminds everyone working on a staging site that they’re not on production, preventing accidental edits and user confusion.

By Founder & Lead Developer

Last updated

2 minutes

Key takeaways

  • Single toggle, no nested options
  • Visible banner in the WordPress admin
  • Customizable banner text and color
  • Shows on every admin page
  • Pairs with [Staging Protection](security-staging-protection.md) for comprehensive staging safety

What Is the Staging Environment Indicator feature?

Working on a staging site can be confusing, especially when the staging site looks identical to the production site. The Staging Environment Indicator feature adds a visible banner (e.g., a yellow bar at the top of the admin) that says “STAGING SITE” or similar, so everyone knows they’re not on the production site.

This is a small but important safety feature. The most common staging site accident is: a team member thinks they’re on the staging site, makes a change, but is actually on production. The indicator prevents this by making it visually obvious which environment they’re in.

Why You Need It

Staging site accidents are common and serious:

  • Wrong environment edits: A change meant for staging goes to production (or vice versa)
  • User confusion: Editors may not realize they’re on staging, leading to confusion
  • Data leakage: Test data on staging may be visible to editors
  • Email leakage: Staging sites can send emails to real customers

The staging indicator is a low-cost, high-impact way to prevent these accidents.

How to Show the Staging Environment Indicator in WordPress

  1. Step 1

    Navigate to Settings

    Click into the Classic Monks plugin settings in your WordPress dashboard.

  2. Step 2

    Go to the Security Tab

    Click on the Security menu, then click the Staging Protection subtab.

  3. Step 3

    Enable Show Staging Environment Indicator

    Scroll to Show Staging Environment Indicator and toggle on. The indicator appears immediately in the admin.

    Staging protection settings enabled

  4. Step 4

    Save Changes

    Click Save Changes.

  5. Step 5

    Test

    Visit any admin page. The staging indicator should be visible (e.g., as a yellow bar at the top of the admin).

Configuration Options

Option Description Default
Show Staging Environment Indicator Master toggle. On

The banner text and color are customizable via filters. The default banner is a yellow bar with the text “STAGING ENVIRONMENT”.

What Gets Affected

  • The WordPress admin: the indicator is visible on every admin page
  • The frontend: the indicator is NOT shown on the frontend (only admin)
  • The user experience: editors see the indicator and know they’re on staging
  • The safety: fewer accidents from editing the wrong environment

What Does NOT Get Affected

  • The frontend: not affected
  • The staging protection (HTTP auth, search engine block, etc.): not affected (this is a separate toggle)
  • The user accounts: not affected
  • The WordPress functionality: not affected

Advanced Options (Developers)

This feature registers 1 WordPress hook in staging-protection.php:

Actions:

  • wp_footer calls CM_Staging_Protection::add_staging_indicator() (Renders staging environment indicator bar)
// Hooked in staging-protection.php
add_action( 'wp_footer', 'CM_Staging_Protection::add_staging_indicator' );

The feature modifies WordPress behavior by registering or removing hooks. Disabling it reverses those changes and WordPress returns to its default behavior.

Troubleshooting

5 problems and how to fix each one.

The indicator is not showing

Cause: The toggle is off, or a caching plugin is serving the old admin.
Fix: Verify the toggle is on. Clear any caching plugins. The indicator is rendered server-side, so caching can hide it.

The indicator is showing on the frontend

Cause: A theme or plugin is rendering the indicator outside the admin.
Fix: The indicator is added via the admin_notices action or admin_bar_menu action, which only fires in the admin. If a theme is showing it on the frontend, check the theme’s hooks.

The indicator is too prominent

Cause: The default styling is intentionally prominent (yellow bar).
Fix: Use the cm_staging_indicator_html filter to customize the styling. Use a less prominent color (e.g., light gray) for less distraction.

I want to show different text for different environments

Cause: The default text is the same for all staging sites.
Fix: Use the cm_staging_indicator_environment_type filter to detect the environment, then customize the text based on the environment.

I want to show the indicator to admins only

Cause: The indicator is shown to all logged-in users.
Fix: Use the cm_staging_indicator_enabled filter to check the user’s role. Show only to administrators and editors, hide from subscribers.

Was this doc helpful?

Your answer tells us which docs to fix first.

Still stuck? Ask on the forum or email help@classicmonks.com.
Joy Chetry
Written by the person who built it

Joy Chetry

Founder & Lead Developer, Classic Monks

Joy is the founder of Classic Monks and GoodMonks Solutions, a web development agency that builds WordPress and WooCommerce sites for clients. Classic Monks grew out of the agency's own need to consolidate 20 to 30 separate plugins into one core stack.

Follow this doc on a real site.

Open a private WordPress site with Classic Monks, WooCommerce and Bricks Builder installed, and follow this doc step by step. Free for 24 hours, no card.

280 docs, written by Joy Chetry 15 day refund window