Do you want to remove admin color scheme options from user profile settings? You’ll find multiple color scheme in the admin profile section. While there’s probably a plugin for this, we have created a quick code snippet that you can use to remove admin color scheme options from user profile.
Instructions:
All you have to do is add this code to your theme’s functions.php file or in a site-specific plugin:
function admin_color_scheme() { global $_wp_admin_css_colors; $_wp_admin_css_colors = 0; } add_action('admin_head', 'admin_color_scheme');
Alternatively, you could use this snippet instead, which uses a different method. All you have to do is add this code to your theme’s functions.php file or in a site-specific plugin:
if(is_admin()){ remove_action("admin_color_scheme_picker", "admin_color_scheme_picker"); }
Note: If this is your first time adding code snippets in WordPress, then please refer to our guide on how to properly copy / paste code snippets in WordPress, so you don’t accidentally break your site.
If you liked this code snippet, please consider checking out our other articles on the site like: 43 best photography themes for WordPress and 9 best WordPress events plugins.
no longer good, gives missing key warning
The solution for WordPress 6 is to use:
$_wp_admin_css_colors = [];
since it is expecting an array.
Thank you so much… 🙂
Thank you so much it is working now:
function admin_color_scheme() {
global $_wp_admin_css_colors;
$_wp_admin_css_colors = [];
}
add_action(‘admin_head’, ‘admin_color_scheme’);
Thanks
wordpress 6 eror wp-admin\user-edit.php on line 303
Works on WordPress 3.8.1 also! Great code!
Thanks for confirming this! I knew would work, but yeah…
Awesome…this worked so well it was a “10 second fix”
Dude, thank you very much, I’ve been banging my head against the wall trying to get rid of this schnizz!
[…] snippet comes to you courtesy of Kevin Chard of WPsnipp.com. For more fun bits of code, check out the WordPress Code Snippets […]
How can I add my own, new color schemes?
I would say the easiest way would be to use this plugin
http://wordpress.org/extend/plugins/easy-admin-color-schemes/
It’s still there. I’m also using the plugin Theme My Login. Any suggestions?
Give this other method a try see if that works for you,
http://wpsnipp.com/index.php/functions-php/remove-admin-color-scheme-picker-from-profile/
The other option if not these would be to use css or jquery to hide it.
I noticed that Theme My Login was using it’s own template, maybe that was making problems. I completely removed Profile Options from the profile editing template, so it’s not a problem anymore.
Sounds great glad to hear you got things working. If you wanted post details on what method you used for the ‘my login’ plugin others may have a use for it as well.
@edinchez:disqus, Thank you for your post; I would like to remove the color scheme options and I’m using Theme My Login; however, I didn’t understand what you did to resolve the issue. Will you please describe it in more detail?
Thank you,
James
delete this, check above for the solution.
First of all make a backup of:
/wp-content/plugins/theme-my-login/templates/profile-form.php
Then open it and delete the code from line 25 to line 62. This is to remove the whole Personal Options section. If you only want to remove the color scheme options section, delete the code from line 34 to line 40.