Select Page

Do you want to enforce a color theme for all admin users? You can enforce a color scheme for all WordPress admin area users using a simple PHP code snippet.

Paste the following code in your theme’s functions.php file:

function force_admin_area_color_scheme() {
    return 'classic'; // The name of the color scheme you want to use goes here.
}

add_filter('get_user_option_admin_color','force_admin_area_color_scheme');

The above code adds a filter for the function get_user_option_admin_color and returns your enforced color scheme. WordPress calls get_user_option_admin_color to get the selected color scheme for the logged-in user. The above code will enforce your chosen color scheme for all users. They won’t be able to change the color scheme.

The above code snippet will force the classic color scheme for all users. You can also use light or midnight or any other color scheme available. You can check the available ones on your Edit Profile page in WordPress admin area.