PHPackages                             roots/wp-stage-switcher - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. roots/wp-stage-switcher

ActiveWordpress-plugin[Utility &amp; Helpers](/categories/utility)

roots/wp-stage-switcher
=======================

WordPress plugin that allows you to switch between different environments from the admin bar

2.4.1(2mo ago)383469.2k↓25.6%423MITPHPPHP &gt;=8.2CI passing

Since Jan 13Pushed 2mo ago24 watchersCompare

[ Source](https://github.com/roots/wp-stage-switcher)[ Packagist](https://packagist.org/packages/roots/wp-stage-switcher)[ Docs](https://roots.io/plugin/stage-switcher/)[ GitHub Sponsors](https://github.com/roots)[ RSS](/packages/roots-wp-stage-switcher/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (7)Versions (13)Used By (3)

WordPress Stage Switcher
========================

[](#wordpress-stage-switcher)

[![Packagist](https://camo.githubusercontent.com/b5781f55aaf1eaecb79ce436815336378f7102a5eae60c3404a2614b51967ae9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f726f6f74732f77702d73746167652d73776974636865722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/roots/wp-stage-switcher)[![Packagist Downloads](https://camo.githubusercontent.com/b23ef1ad448e80bdedcd1de18b4d2a560b6747c9d10ab164e106597ae73dbd72/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f726f6f74732f77702d73746167652d73776974636865723f6c6162656c3d646f776e6c6f61647326636f6c6f72423d32623330373226636f6c6f72413d353235646463267374796c653d666c61742d737175617265)](https://packagist.org/packages/roots/wp-stage-switcher)[![Build Status](https://camo.githubusercontent.com/adfd81fc2c0862c8e46c4aa07e5e5dfe4c8bb986db0a3e8b85b2e2de05dc2b33/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f726f6f74732f77702d73746167652d73776974636865722f6d61696e2e796d6c3f6272616e63683d6d6173746572267374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/adfd81fc2c0862c8e46c4aa07e5e5dfe4c8bb986db0a3e8b85b2e2de05dc2b33/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f726f6f74732f77702d73746167652d73776974636865722f6d61696e2e796d6c3f6272616e63683d6d6173746572267374796c653d666c61742d737175617265)[![Follow Roots](https://camo.githubusercontent.com/222256dbdeac58e77f017d847dca30ff4cab027cdf3abfec8e5bfd59de240547/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f666f6c6c6f7725323040726f6f747377702d3164613166323f6c6f676f3d74776974746572266c6f676f436f6c6f723d666666666666266d6573736167653d267374796c653d666c61742d737175617265)](https://twitter.com/rootswp)[![Sponsor Roots](https://camo.githubusercontent.com/31e13361135ff96d01f1eb97157d052029e6f236249996072d8b6bd60b40e9cd/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73706f6e736f72253230726f6f74732d3532356464633f6c6f676f3d676974687562267374796c653d666c61742d737175617265266c6f676f436f6c6f723d666666666666266d6573736167653d)](https://github.com/sponsors/roots)

A WordPress plugin that allows you to switch between different environments from the admin bar.

[![WordPress Stage Switcher](https://camo.githubusercontent.com/2c88d399d1a6c50c2f154550905b3efd43070572b8bbabbb42bf95cbe808cd34/68747470733a2f2f63646e2e726f6f74732e696f2f6170702f75706c6f6164732f706c7567696e2d73746167652d73776974636865722e706e67)](https://camo.githubusercontent.com/2c88d399d1a6c50c2f154550905b3efd43070572b8bbabbb42bf95cbe808cd34/68747470733a2f2f63646e2e726f6f74732e696f2f6170702f75706c6f6164732f706c7567696e2d73746167652d73776974636865722e706e67)

Support us
----------

[](#support-us)

Roots is an independent open source org, supported only by developers like you. Your sponsorship funds [WP Packages](https://wp-packages.org/) and the entire Roots ecosystem, and keeps them independent. Support us by purchasing [Radicle](https://roots.io/radicle/) or [sponsoring us on GitHub](https://github.com/sponsors/roots) — sponsors get access to our private Discord.

Requirements
------------

[](#requirements)

You'll need to have `ENVIRONMENTS` and `WP_ENV` defined in your WordPress config.

The `ENVIRONMENTS` constant must be an array of `'environment' => 'url'` elements:

```
$envs = [
  'development' => 'http://example.dev',
  'staging'     => 'http://staging.example.com',
  'production'  => 'http://example.com'
];
Config::define('ENVIRONMENTS', $envs);
```

`WP_ENV` must be defined as the current environment:

```
Config::define('WP_ENV', 'development');
```

If you use [Bedrock](https://github.com/roots/bedrock), `WP_ENV` is already defined in the config.

Installation
------------

[](#installation)

This plugin must be installed via Composer. Add wp-stage-switcher to your project's dependencies:

```
composer require roots/wp-stage-switcher
```

Filters
-------

[](#filters)

### `bedrock/stage_switcher_colors`

[](#bedrockstage_switcher_colors)

Customize the background colors for each environment in the admin bar menu. Returns an array of `'environment' => 'color'` pairs.

Default colors:

```
[
  'development' => 'firebrick',
  'staging'     => 'chocolate',
  'production'  => 'transparent',
]
```

Example usage:

```
add_filter('bedrock/stage_switcher_colors', function ($colors) {
  return [
    'development' => '#dc2626',
    'staging'     => '#ea580c',
    'production'  => '#10b981',
  ];
});
```

### `bedrock/stage_switcher_visibility`

[](#bedrockstage_switcher_visibility)

Control who can see the stage switcher in the admin bar. Defaults to `is_super_admin()`.

Example usage:

```
add_filter('bedrock/stage_switcher_visibility', function ($visible) {
  return current_user_can('manage_options');
});
```

Community
---------

[](#community)

Keep track of development and community news.

- Join us on Discord by [sponsoring us on GitHub](https://github.com/sponsors/roots)
- Join us on [Roots Discourse](https://discourse.roots.io/)
- Follow [@rootswp on Twitter](https://twitter.com/rootswp)
- Follow the [Roots Blog](https://roots.io/blog/)
- Subscribe to the [Roots Newsletter](https://roots.io/subscribe/)

###  Health Score

68

—

FairBetter than 99% of packages

Maintenance86

Actively maintained with recent releases

Popularity57

Moderate usage in the ecosystem

Community33

Small or concentrated contributor base

Maturity83

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 50% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~448 days

Recently: every ~412 days

Total

11

Last Release

68d ago

Major Versions

1.0.3 → 2.0.02016-02-10

PHP version history (3 changes)1.0.0PHP &gt;=5.3.0

2.0.0PHP &gt;=5.4.0

2.4.0PHP &gt;=8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/4f6a3f6809aec26ab615cf9c5ae69c37d5068c8613e77a3aad4e97bad98d0fb3?d=identicon)[swalkinshaw](/maintainers/swalkinshaw)

![](https://www.gravatar.com/avatar/f3f71fa88954b93f55af5e121f1d8c38d240a0d17712c092a389bcccffa34415?d=identicon)[retlehs](/maintainers/retlehs)

---

Top Contributors

[![retlehs](https://avatars.githubusercontent.com/u/115911?v=4)](https://github.com/retlehs "retlehs (30 commits)")[![swalkinshaw](https://avatars.githubusercontent.com/u/295605?v=4)](https://github.com/swalkinshaw "swalkinshaw (11 commits)")[![swissspidy](https://avatars.githubusercontent.com/u/841956?v=4)](https://github.com/swissspidy "swissspidy (3 commits)")[![dotsam](https://avatars.githubusercontent.com/u/4316742?v=4)](https://github.com/dotsam "dotsam (3 commits)")[![grappler](https://avatars.githubusercontent.com/u/1785641?v=4)](https://github.com/grappler "grappler (3 commits)")[![kalenjohnson](https://avatars.githubusercontent.com/u/2036520?v=4)](https://github.com/kalenjohnson "kalenjohnson (2 commits)")[![xeader](https://avatars.githubusercontent.com/u/1153759?v=4)](https://github.com/xeader "xeader (2 commits)")[![ocean90](https://avatars.githubusercontent.com/u/617637?v=4)](https://github.com/ocean90 "ocean90 (1 commits)")[![Arty2](https://avatars.githubusercontent.com/u/3519269?v=4)](https://github.com/Arty2 "Arty2 (1 commits)")[![knowler](https://avatars.githubusercontent.com/u/6908001?v=4)](https://github.com/knowler "knowler (1 commits)")[![aaemnnosttv](https://avatars.githubusercontent.com/u/1621608?v=4)](https://github.com/aaemnnosttv "aaemnnosttv (1 commits)")[![runofthemill](https://avatars.githubusercontent.com/u/8418440?v=4)](https://github.com/runofthemill "runofthemill (1 commits)")[![valentinocossar](https://avatars.githubusercontent.com/u/4087384?v=4)](https://github.com/valentinocossar "valentinocossar (1 commits)")

---

Tags

wordpresswordpress-pluginwp-adminbarwp-envwp-environmentwordpress

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/roots-wp-stage-switcher/health.svg)

```
[![Health](https://phpackages.com/badges/roots-wp-stage-switcher/health.svg)](https://phpackages.com/packages/roots-wp-stage-switcher)
```

###  Alternatives

[roots/bedrock

WordPress boilerplate with Composer, easier configuration, and an improved folder structure

6.5k463.8k2](/packages/roots-bedrock)[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4028.5k10](/packages/helsingborg-stad-municipio)[vinkla/wordplate

The WordPlate boilerplate

2.2k5.3k](/packages/vinkla-wordplate)[mediawiki/maps

Adds various mapping features to MediaWiki

84152.3k3](/packages/mediawiki-maps)[civicrm/civicrm-drupal-8

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

19251.4k3](/packages/civicrm-civicrm-drupal-8)[altis/core

Core module for Altis

19228.0k3](/packages/altis-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
