Remove Wordpress Admin Bar

Quick-Tip: How To Disable The WordPress Admin Bar For Non Administrators

by Jesús Ramirez, Follow him on Facebook!
Posted in Quick Tips, Wordpress

WordPress 3.1 introduced many new useful improvements, one of them being the admin bar.

However, for some websites the admin bar might be a little bit of an inconvenience. If this is the case for you then you can easily disable the admin bar from showing up by simply editing your user preferences.

On your dashboard just go to “Users”, select the user you want to disable the admin bar for and make sure you un-check the “when viewing site” box to hide the admin bar when you are viewing your actual website.

Wordpress User Options - Admin Bar

However, doing this requires having each user to manually hide the admin bar one at a time. This can be a very long and tedious process specially if you have dozens or hundreds of users.

Perhaps you’re running a membership website and you want to disable the WordPress Admin Bar for all users except administrators. If that is the case then I have something you are just going to love! Simply add the following code to your theme’s functions.php file:

/* Disable the Admin Bar for all but admins. */
if(!current_user_can('administrator')):
show_admin_bar(false);
endif;

If you want to disable the admin bar entirely for everyone, just add the code below to your themes functions.php file:

/* Disable the Admin Bar for everyone. */
show_admin_bar(false);

You could also a use a WordPress plugin called Disable Admin Bar that will do the same thing for you, but since you’re just copying and pasting into your functions.php file then you should have no need for the plugin.

If you enjoyed this article, get email updates (it's free)

Other Posts You Might Like:


Leave a Comment

You can 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>

You have to use a valid email address To subscribe to our newsletter. Youll receive a confirmation email to make sure your email address is valid and working, clicking the link will automatically add you.

Links in comments that are not related to the topic (such as "signature links") will be deleted. Use your real name, if you use "keywords" instead of your real name your comment will be deleted. Anonymous commenting is not allowed.

Loading Quotes...