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

188

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.