HOWTO: Show Admin Bar to Admin Users Only

Since WordPress 3.1 – after you log in to a WordPress site – you now see a dark grey bar at the top. If you only want users of a certain role to see it (admins vs. subscribers) you can easily set that up by adding the following code to your functions.php file:

if (!current_user_can('manage_options')) {
	add_filter('show_admin_bar', '__return_false');
}

You can also only show the bar to editors, authors, etc by changing the first line. You can learn more about roles/capabilities: http://codex.wordpress.org/Roles_and_Capabilities

About the Author...

Jennifer Zelazny

I am a Penn State alumni, avid golfer, kick boxer, volunteer, and Chicagoland WordPress developer who always enjoys a refreshing Coca-Cola.