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.

Join My Newsletter

Receive tips on business, iOS Development and WordPress.
Learn more about me and my experiences online.


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

  2. donĀ“t need to touch the code.

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

Speak Your Mind