How to remove the top admin bar in WordPress 3.1

Here is how to remove the WordPress 3.1 admin bar in one line of code:

add_filter( 'show_admin_bar', '__return_false' );

Add that to your WordPress theme functions.php file and you are set.

To have the admin bar show up only for Admin just wrap the one line of code like this:

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

I’m sure someone has written an entire plugin to handle one line of code, this just seemed easier.

2 comments

Toby Barnett |

Thanks for the one liner! The admin bar is an annoyance when editing (at least for this multi-window user). Cheers!

Juan |

donĀ“t need to touch the code.

You can select that option from “your profile” in the admin area