Install
Upload it under Plugins → Add New Plugin → Upload Plugin, then activate.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/gosuperrad/wp-environments/releases/download/v1.0.0/wp-environments.zipThis plugin allows you to set up different environments for your WordPress site. It is useful for when you have a development site and a production site, and you want to be able to easily distinguish between environments.
Installation
Composer (recommended)
The plugin isn't published on Packagist, so add it as a VCS repository in your site's
composer.json:
"repositories": [
{ "type": "vcs", "url": "https://github.com/gosuperrad/wp-environments" }
]
Then require it:
composer require superrad/wp-environments:^1.0
The plugin pulls in composer/installers, so it lands in your plugins directory
automatically — web/app/plugins/wp-environments/ on Bedrock,
wp-content/plugins/wp-environments/ otherwise — and resolves the latest v1.x tag. Use
dev-main instead of ^1.0 to track the main branch. (This repo is public, so no auth is
needed; a private clone would need a GitHub token in auth.json or SSH.)
Manual
- Download
wp-environments.zipfrom the latest release. - In the WordPress admin, go to Plugins → Add New → Upload Plugin and upload the zip
(or unzip it into
wp-content/plugins/). - Activate the plugin through the Plugins menu.
Configure
Set the environment type in wp-config.php:
define( 'WP_ENVIRONMENT_TYPE', 'local' ); // local | development | staging | production
Usage
The plugin will add a colored bar to the top of the admin bar. The color of the bar will depend on the environment type.
The default colors are:
-
Local:
- Color: Green
- Rationale: Local is usually the starting point for most developers, and green is often associated with safety and a starting point. It signifies that changes here don't affect anyone else.
-
Development:
- Color: Blue
- Rationale: Blue is calming and denotes that while it's beyond the local environment, it's a place for testing and iteration without major consequences.
-
Staging:
- Color: Purple
- Rationale: Purple sets staging visibly apart from the other environments. Staging is typically a pre-production environment that mirrors production as closely as possible — the last line of defense before going live — so it gets its own unmistakable color.
-
Production:
- Color: Red
- Rationale: Red typically denotes danger or a need for caution. In the context of web development or software, it indicates that any changes or issues here have real-world consequences for users.
Releases
1 release. Each count is every asset in that release; expand a row for the breakdown.