Family Encyclopedia >> Electronics

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

As experienced WordPress developers, we've customized countless sites since the 3.8 admin interface launch. This fully responsive dashboard shines on every device, with 8 built-in color schemes (and options for more). Here's how to automatically apply a default scheme to new users and optionally lock it in place.

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

To assign a default scheme like "Sunrise" to every new registrant, add this code to your theme's functions.php file or a custom 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 runs on user registration, setting the scheme without affecting existing users. Note: Users can still change it via their profile.

Prevent Users from Changing the Admin Color Scheme

To enforce your default for non-admins, add this to functions.php or a custom plugin:

function restrict_admin_color_scheme() {
    if ( ! current_user_can( 'manage_options' ) ) {
        remove_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' );
    }
}
add_action( 'admin_init', 'restrict_admin_color_scheme', 1 );

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

This hides the color picker from the profile screen for everyone except administrators, ensuring consistency across your site.

With years of hands-on WordPress optimization, we trust this streamlines your admin experience. What's your go-to color scheme? Share in the comments below!