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.


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

    -- Toby Barnett

  • donĀ“t need to touch the code.

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

    -- Juan