Stage Switcher

February 3, 2018

Stage Switcher

Packagist Packagist Downloads

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


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

The ENVIRONMENTS constant must be a serialized array of 'environment' => 'url' elements:

$envs = [
  'development' => '',
  'staging'     => '',
  'production'  => ''
define('ENVIRONMENTS', serialize($envs));

WP_ENV must be defined as the current environment:

define('WP_ENV', 'development');

If you use Bedrock, WP_ENV is already defined in the config.


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

composer require roots/wp-stage-switcher 2.0.0

Or manually add it to your composer.json:

"require": {
  "php": ">=5.4.0",
  "wordpress": "4.4.2",
  "roots/wp-stage-switcher": "2.0.0"


Use the Roots Discourse to ask questions and get support.

  • Version 2.0.0
  • 215 stars 6 contributors

View on GitHub

Join over 5,800 subscribers on our newsletter to get the latest Roots updates, along with occasional tips on building better WordPress sites.

Looking for WordPress plugin recommendations, the newest modern WordPress projects, and general web development tips and articles?

“Easily the best WordPress email I get.” Colin OBrien

Follow us on Twitter @rootswp

Ready to checkout?