Disable Admin Bar and Hide Preferences

Before you consider removing the admin bar, you should read this.

WordPress 3.1 was released earlier today and one of the key features is the admin bar, which allows you to get to your most-used dashboard pages with a single click. However, the admin bar is not for everyone and you can easily hide it by visiting your profile page.

You can also disable the admin bar for all users on your site by adding the following code to a plugin or the functions file of your theme:

add_filter( 'show_admin_bar', '__return_false' );

This will disable the admin bar for all users on your site but they will still see the admin bar preferences in their profile. You can hide the admin bar preferences using:

add_action( 'admin_print_scripts-profile.php', 'hide_admin_bar_prefs' );
function hide_admin_bar_prefs() { ?>
<style type="text/css">
	.show-admin-bar { display: none; }
</style>
<?php
}

Note: If you are using this code to only hide the preferences without disabling the admin bar, your users can still change the values by manually editing the hidden variables before the page is submitted.

8 thoughts on “Disable Admin Bar and Hide Preferences

  1. Pingback: Common problems in WordPress 3.1 | sillybean.net

  2. Thank you very much for that code. I’ve successfully implemented it and voila! No more admin bar and its prefs.

    This is a very simple fix. It makes me wonder why the WordPress guys don’t simply add a option in the settings to enable/disable the new features they build. They should know by now that not everyone is going to want an admin bar. Why not give an easy way to turn it off?

  3. thanks this worked great. For me, the tool bar suppressed my theme colors and made all the text gray and the background black so it had to go! My theme enables me to choose between three different color schemes, one that I’ve tweaked myself and two others, gray and white and just plain white. As a matter of fact, it’s still suppressing the colors I tweaked. Is there a way to find that code and delete it altogether?

  4. Re: Reconsidering turning it off.

    I have a valid reason to turn it off: new theme. Its a sore thumb jabbing in my face as I design and piece together this new theme. Once the theme is done, sure I would probably turn it back on. But for now I find it extremely distracting.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>