Beginner's Guide for WordPress - Start your WordPress Blog in minutes.
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
Recommended
WordPress Plugins
View all Guides

How to Set Default Admin Color Scheme for New Users in WordPress

Last updated on by
Special WordPress Hosting offer for WPBeginner Readers
How to Set Default Admin Color Scheme for New Users in WordPress

One of the most talked about feature of WordPress 3.8 is the new admin interface. It is fully responsive and looks great on all devices. If you don’t like the default colors, then you can choose from 8 different admin color schemes and even add new ones. In this article, we will show you how to set a default admin color scheme in WordPress for new users. We will also show you how to prevent users from changing the default WordPress admin color scheme.

Setting a default color scheme for new users in WordPress

In order to set a default WordPress admin color scheme for new users, all you need to do is add the following code in your theme’s functions.php file or in a site-specific plugin:

function set_default_admin_color($user_id) {
	$args = array(
		'ID' => $user_id,
		'admin_color' => 'sunrise'
	);
	wp_update_user( $args );
}
add_action('user_register', 'set_default_admin_color');

This code changes the default WordPress admin color scheme to Sunrise for each new user who registers on your site. It does not change the color scheme for previously registered users. Also, this code will not stop users from choosing another admin color scheme. Users can still go to their profile section and choose any other color scheme they like.

How to Stop Users From Switching Admin Color Schemes

If you would like to set a default color scheme for your site and do not want users to use any other color scheme, then all you have to do is add the following code in your theme’s functions.php file or in a site-specific plugin:

if ( !current_user_can('manage_options') )
remove_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' );

Admin color scheme option removed from user profiles in WordPress

This code will remove the admin color scheme picker from the profile screen of all users except users with administrator privileges.

We hope this article helped you set a default WordPress admin color scheme and disable the color scheme picker from user profiles on your WordPress site.

If you could change the default admin color scheme, which color scheme would you pick? Let us know by leaving a comment below.


Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Page maintained by Syed Balkhi.

WPBeginner's Video Icon
Our HD-Quality tutorial videos for WordPress Beginners will teach you how to use WordPress to create and manage your own website in about an hour. Get started now »

Comments

  1. Miikey says:

    Ok I found the solution. So the problem described as followes, if a user is updating his profile e.g. changing his name and click on update the default scheme is loading, because it is marked. As a user you can’t see it, if you using the code above and removes the admin-color- scheme-picker.
    But with this piece of code you can make a color-scheme as default for all none admins. It’s overriding your choosen color-scheme and all is fine.

    Greetz Miikey

  2. Miikey says:

    Found a problem, if a user is updating his profile the standard theme is activated. Can anyone help?

  3. Terence Milbourn says:

    Admin Color Schemes ~ they should be switchable NOT by user but by site. Think how much swearing and shouting that would save!

    Seriously though, what donut thought that making it switchable by user profile was a good idea? I guess there’s some things about WordPress and WP developers I will never understand.

    By the way, if you ever come across a code snippet that I can add to my functions.php and give me a choice of selecting admin color scheme by site, rather than user, I will be forever in your debt.

  4. Jessica Yazbek says:

    If you want to do this for all existing users, just run the following SQL in your database:

    UPDATE wp_usermeta SET meta_value = ‘sunrise’ WHERE meta_key = ‘admin_color’;

    Obviously change ‘sunrise’ to the color scheme you want to use (and change wp_usermeta to your usermeta table, if that’s not the table name you use).

    Cheers.

  5. nick says:

    Thanks just what I needed!

  6. Elliott Richmond says:

    You can also take this one step further by changing the colour scheme per role, something I recently wrote a snippet for on WP Snippets til Christmas set the WordPress admin colour scheme for different users and roles

  7. mvaneijgen says:

    Is it possible to do this for all sites in a WordPress Multisite installation?

    • Elliott Richmond says:

      Yes the logic should work the same across the whole network.

      You could take it one step further by checking the blog id first then changing the colour but, it could get more complicated and confusing that way as users can be users of multiple sites but, it still possible by checking which site they were currently logged into I guess.

  8. ConnieM says:

    I would switch to a color scheme which will give more contrast to the text areas in the admin. It is sometimes hard to identify an input field or text-area.
    Unfortunately the new schemes don’t offer that.

    What is disgusting and controverse to your statement that the new admin area looks great on any device is the fact that you get empty squares/boxes (in my case 2!) in the dashboard and users will not stop to ask for what these empty dotted-bordered squares are meant.
    Do you know how to get rid of these empty boxes?????

    • Garratt says:

      Unfortunately with the new update they removed the functionality to customize the dashboard. So those 2 square dotted boxes are where you can drag widgets.

      There used to be an option to change it to 1,2,3,4 columns but now it’s default is 4 columns and it can’t be changed. So if you used to only use 2 widgets on the dashboard in a 2 column layout, it now looks terribad.

      I used to use recent comments and Google analytics stats on the dashboard in 2 column, now I have to add 2 widgets I don’t ever use just to make it look half decent when I log in… litle OCD about it to be honest.

      It’s driving me crazy.

      Hopefully Syed will look into it and post a fix

  9. Peter Le says:

    I want to keep the default theme, but instead of the blue, have it be green instead.
    How would I go about doing this?

    • Elliott Richmond says:

      You can just change the value of the array in the line that says ‘admin_color’ => ‘sunrise’
      eg change it to one of the following:
      ‘admin_color’ => ‘default’
      ‘admin_color’ => ‘light’
      ‘admin_color’ => ‘blue’
      ‘admin_color’ => ‘coffee’
      ‘admin_color’ => ‘ectoplasm’
      ‘admin_color’ => ‘midnight’
      ‘admin_color’ => ‘ocean’
      ‘admin_color’ => ‘sunrise’

      Not specifically Green but that’s how you change it.

      • Garratt says:

        You missed the question, which was css related.
        He wants the dark grey theme (default – and the darkest color) but instead of the blue highlights and mouse-overs, change them to green.

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.