Sometimes, you want to set a default WordPress admin color scheme for
new users or specific users. Or you might want to stop users from
changing the colour. What you just need to do is to put the code below
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'); 

Also, this code will not stop users from choosing another admin color scheme.
But users can still go and choose another color scheme they like from their profile
section.

Read: How to add Favicon to your WordPress site

How to Stop Users From Switching Admin Color Schemes 

Should you 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' );

If you have found a spelling error, please, notify us by selecting that text and pressing Ctrl+Enter.

Also Read  How to Display Comments Counts in WordPress

CMSFolks Editorial Crew

Editorial Staff at CMSFolks is a team of WordPress experts led by Ajayi Adekunle. Site maintained by CMSFolks Studio.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Close Menu
×

Spelling error report

The following text will be sent to our editors: