Title: Force Admin Color Scheme
Author: Scott Reilly
Published: <strong>mars 11, 2016</strong>
Last modified: avril 17, 2025

---

Search plugins

![](https://ps.w.org/force-admin-color-scheme/assets/banner-772x250.png?rev=1368949)

![](https://ps.w.org/force-admin-color-scheme/assets/icon-128x128.png?rev=1368949)

# Force Admin Color Scheme

 By [Scott Reilly](https://profiles.wordpress.org/coffee2code/)

[Download](https://downloads.wordpress.org/plugin/force-admin-color-scheme.2.1.zip)

 * [Details](https://tah.wordpress.org/plugins/force-admin-color-scheme/#description)
 * [Reviews](https://tah.wordpress.org/plugins/force-admin-color-scheme/#reviews)
 *  [Installation](https://tah.wordpress.org/plugins/force-admin-color-scheme/#installation)
 * [Development](https://tah.wordpress.org/plugins/force-admin-color-scheme/#developers)

 [Support](https://wordpress.org/support/plugin/force-admin-color-scheme/)

## Description

Though it is typically an individually configurable aspect of WordPress, there are
times when forcing a single admin color scheme upon all users of a site can be warranted,
such as to:

 * Provide a unique backend color scheme for multiple sites used by the same set
   of users to reinforce the difference between the sites.
 * Clearly denote backend differences between a production and staging/test instance
   of a site. Especially given that in this situation with the same plugins active
   and often the same data present, it can be easy to get mixed up about what site
   you’re actually on.
 * Force a site brand-appropriate color scheme.
 * Crush the expression of individuality under your iron fist.

Additionally, the plugin removes the « Admin Color Scheme » profile setting from
users who don’t have the capability to set the admin color scheme globally since
being able to set its value gives them the false impression that it may actually
apply.

Links: [Plugin Homepage](https://coffee2code.com/wp-plugins/force-admin-color-scheme/)
| [Plugin Directory Page](https://wordpress.org/plugins/force-admin-color-scheme/)
| [GitHub](https://github.com/coffee2code/force-admin-color-scheme/) | [Author Homepage](https://coffee2code.com)

### Hooks

The plugin is further customizable via one filter. Typically, code making use of
filters should ideally be put into a mu-plugin or site-specific plugin (which is
beyond the scope of this readme to explain).

**c2c_force_admin_color_scheme (filter)**

The ‘c2c_force_admin_color_scheme’ filter allows you to set or override the forced
admin color scheme. Use of the constant (« ) takes priority over the filtered value,
but the filtered value takes priority over the value set via the admin.

Arguments:

 * $color (string): The name of the admin color scheme. If an empty string is returned,
   then the plugin will behave as if no forced admin color scheme has been defined.

Example:

    ```
    /**
     * Sets a forced admin color scheme based on user. Admins get one color scheme, whereas everyone else gets another.
     *
     * @param string $color The current forced admin color scheme. Empty string indicates no forced admin color scheme.
     * @return string
     */
    function my_c2c_force_admin_color_scheme( $color ) {
        return current_user_can( 'manage_options' ) ? 'sunrise' : 'coffee';
    }
    add_filter( 'c2c_force_admin_color_scheme', 'my_c2c_force_admin_color_scheme' );
    ```

## Screenshots

 * [[
 * The profile page for an administrative user who has the checkbox to force an 
   admin color scheme on users, though one hasn’t been forced yet.
 * [[
 * The profile page for an administrative user who has the checkbox to force an 
   admin color scheme on users, with a color scheme having been forced.
 * [[
 * The profile page for an administrative user when the forced admin color scheme
   is configured via the filter.
 * [[
 * The profile page for an administrative user when the forced admin color scheme
   is configured via the constant.
 * [[
 * The profile page for an administrative user when the forced admin color scheme
   is incorrectly configured via the constant. A similar warning also appears if
   the color scheme is incorrectly configured via the filter as well.

## Installation

 1. Install via the built-in WordPress plugin installer. Or install the plugin code
    inside the plugins directory for your site (typically `/wp-content/plugins/`).
 2. Activate the plugin through the ‘Plugins’ admin menu in WordPress
 3. As an admin, edit your own profile (Users -> Your Profile) and choose the Admin
    Color Scheme you want to apply to all users by setting the color scheme for yourself.
 4. Check the « Force this admin color scheme on all users? » checkbox and then save
    the update to your profile.
 5. Optional: Use the `c2c_force_admin_color_scheme` filter in custom code to programmatically
    set the forced admin color scheme with greater control.
 6. Optional: Define the `C2C_FORCE_ADMIN_COLOR_SCHEME` constant somewhere (such as`
    wp-config.php`) if you’d prefer to configure the color that way. Configuring the
    color in this manner takes precedence over the color as configured via an admin’s
    profile. Also, if the constant is used, the plugin prevents the setting of admin
    color schemes entirely from within user profiles, including by admins.

## FAQ

### Why isn’t everyone seeing the same admin color scheme after activating this plugin?

Have you followed all of the installation instructions? You must configure the forced
admin color scheme by setting the color scheme for yourself while also checking 
the « Force this admin color scheme? » checkbox.

### How do I resume letting users pick their own color schemes?

You can simply deactivate the plugin. Though bear in mind that if you later reactivate
the plugin, the forced color scheme at the time the plugin was deactivated (if there
was one) may be reinstated (depending on if the constant, hooked filter, and/or 
plugin setting are still present).

To keep the plugin active, you can pursue the following steps (whichever may apply
to you):
 * If the forced color scheme is being set via the constant or code making
use of the filter hook, then the code relating to either of those cases must be 
commented out or disabled. * If the « Force this admin color scheme? » setting was
used, then update an administrative profile to uncheck the checkbox and save.

### Can I force different admin color schemes based on the user?

Yes, but only via custom coding by making use of the `c2c_force_admin_color_scheme`
filter. See the documentation for the filter for an example.

### What happens if a custom admin color scheme was forced, but later the custom admin color scheme is no longer available (e.g. I deactivated the plugin providing the custom admin color scheme)?

The plugin will recognize that the chosen admin color scheme is no longer valid 
and will act as if one isn’t set. In such a case, users would then see their individually
chosen admin color schemes. If the custom admin color scheme becomes available again(
before a new existing color scheme is selected as the new scheme to be forced), 
then the plugin will reinstate it as the forced admin color scheme.

### Why is the admin color scheme picker still functional, or even still present at all, when the color scheme is set via the filter or constant and thus cannot be changed via the picker?

Just to be clear, if an admin color scheme is being forced, then non-admininistrative
users won’t see the admin color scheme picker at all.

The plugin does not disable the admin color scheme picker for administrative users
even if a value is directly configured in code (via the constant or the filter) 
so that the admin color schemes can still be seen and previewed in case an admin
user wants to evaluate alternatives.

### Does this plugin have unit tests?

Yes. The tests are not packaged in the release .zip file or included in plugins.
svn.wordpress.org, but can be found in the [plugin’s GitHub repository](https://github.com/coffee2code/force-admin-color-scheme/).

## Reviews

![](https://secure.gravatar.com/avatar/c7229529f9a6b40a35655dfd271146c079a81154f3c24bd6d5444492e494a5d4?
s=60&d=retro&r=g)

### 󠀁[For a better orientation in a multiiste](https://wordpress.org/support/topic/for-a-better-orientation-in-a-multiiste/)󠁿

 [Daniel](https://profiles.wordpress.org/dhoffmann/) mai 30, 2019

I’m running a small multisite and needed a better orientation for my authors. thanks
a lot.

![](https://secure.gravatar.com/avatar/fc2b374d1413bd75fc568548abe3bc494edab5e956e082c7ba5ff80330239ec2?
s=60&d=retro&r=g)

### 󠀁[Does exactly what it sais it does](https://wordpress.org/support/topic/does-exactly-what-it-sais-it-does/)󠁿

 [toxicradon](https://profiles.wordpress.org/toxicradon/) septembre 3, 2016

We use this plugin, to get a consistent branding for our customers. Together with«
Admin Color Schemer » it gives us the ability to make sure that the client sees 
their panel in either their site colors, or our company colors without us having
to worry, they will accidently change it. I often also pair this plugin with « WP
Admin UI Customize » to brand the login-screen and keep less tech-savvy clients 
from being overwhelmed by the options Wordpress offers. Those three are my go-to
plugins for branding my sites and keeping the user-experience consistent.

 [ Read all 2 reviews ](https://wordpress.org/support/plugin/force-admin-color-scheme/reviews/)

## Contributors & Developers

“Force Admin Color Scheme” is open source software. The following people have contributed
to this plugin.

Contributors

 *   [ Scott Reilly ](https://profiles.wordpress.org/coffee2code/)

“Force Admin Color Scheme” has been translated into 1 locale. Thank you to [the translators](https://translate.wordpress.org/projects/wp-plugins/force-admin-color-scheme/contributors)
for their contributions.

[Translate “Force Admin Color Scheme” into your language.](https://translate.wordpress.org/projects/wp-plugins/force-admin-color-scheme)

### Interested in development?

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

## Changelog

#### 2.1 (2025-02-15)

Highlights:

This minor release fixes a bug that prevented a forced color scheme from being set
or unset if one was being forced via the constant, adds clarifying help text, prevents
markup from containing unintended markup, removes unit tests from release packaging,
updates compatibility through WP 6.8+, and a few more minor changes.

Details:

 * Fix: Allow saving a forced admin color scheme even if constant is set (the constant
   will still take precedence unless invalid)
 * New: Add help text under the checkbox, if checked, to clarify that unchecking
   it will unset the forced color scheme
 * New: Add `get_color_scheme_via_setting()` to get the forced admin color scheme
   saved as a plugin setting
 * Change: Prevent translations from containing unintended markup
 * Hardening: Sanitize submitted color scheme name
 * Change: Prevent unwarranted PHPCS complaint
 * Change: Add FAQ entry regarding allowing users to choose admin colors schemes
   again
 * Change: Change word used in output string
 * Change: Add missing inline comment for translators
 * Change: Note compatibility through WP 6.8+
 * Change: Note compatibility through PHP 8.3+
 * Change: Update copyright date (2025)
 * New: Add `.gitignore` file
 * Change: Remove development and testing-related files from release packaging
 * Change: Tweak formatting in `README.md`
 * Change: Fix some typos in inline documentation
 * Unit tests:
    - Hardening: Prevent direct web access to `bootstrap.php`
    - Allow tests to run against current versions of WordPress
    - New: Add `composer.json` for PHPUnit Polyfill dependency
    - Change: Explicitly define return type for overridden methods
    - Change: In bootstrap, store path to plugin directory in a constant
    - Change: Prevent PHP warnings due to missing core-related generated files
 * Change: Add more potential TODO items and reformat some existing entries

#### 2.0.3 (2021-10-14)

 * Change: Use ‘translators’ instead of ‘translator’ as prefix for translator comments
 * Change: Note compatibility through WP 5.8+
 * Change: Tweak installation instruction
 * Unit tests:
    - Change: Restructure unit test directories
       * Change: Move `phpunit/` into `tests/`
       * Change: Move `phpunit/bin` into `tests/`
    - Change: Remove ‘test-‘ prefix from unit test file
    - Change: In bootstrap, store path to plugin file constant
    - Change: In bootstrap, add backcompat for PHPUnit pre-v6.0

#### 2.0.2 (2021-04-11)

 * Change: Note compatibility through WP 5.7+
 * Change: Update copyright date (2021)

_Full changelog is available in [CHANGELOG.md](https://github.com/coffee2code/force-admin-color-scheme/blob/master/CHANGELOG.md)._

## Meta

 *  Version **2.1**
 *  Last updated **1 année ago**
 *  Active installations **600+**
 *  WordPress version ** 4.1 or higher **
 *  Tested up to **6.8.5**
 *  Languages
 * [English (US)](https://wordpress.org/plugins/force-admin-color-scheme/) and [Portuguese (Portugal)](https://pt.wordpress.org/plugins/force-admin-color-scheme/).
 *  [Translate into your language](https://translate.wordpress.org/projects/wp-plugins/force-admin-color-scheme)
 * Tags
 * [admin](https://tah.wordpress.org/plugins/tags/admin/)[coffee2code](https://tah.wordpress.org/plugins/tags/coffee2code/)
   [color scheme](https://tah.wordpress.org/plugins/tags/color-scheme/)[staging](https://tah.wordpress.org/plugins/tags/staging/)
 *  [Advanced View](https://tah.wordpress.org/plugins/force-admin-color-scheme/advanced/)

## Ratings

 5 out of 5 stars.

 *  [  2 5-star reviews     ](https://wordpress.org/support/plugin/force-admin-color-scheme/reviews/?filter=5)
 *  [  0 4-star reviews     ](https://wordpress.org/support/plugin/force-admin-color-scheme/reviews/?filter=4)
 *  [  0 3-star reviews     ](https://wordpress.org/support/plugin/force-admin-color-scheme/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/force-admin-color-scheme/reviews/?filter=2)
 *  [  0 1-star reviews     ](https://wordpress.org/support/plugin/force-admin-color-scheme/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/force-admin-color-scheme/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/force-admin-color-scheme/reviews/)

## Contributors

 *   [ Scott Reilly ](https://profiles.wordpress.org/coffee2code/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/force-admin-color-scheme/)

## Donate

Would you like to support the advancement of this plugin?

 [ Donate to this plugin ](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6ARCFJ9TX3522)