WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Every time I create a new site under 3.1, my first trip is to the Users > Admin User profile page to uncheck the "admin bar" checkbox.

I'd like to place a script in my theme's functions.php to do this automatically.

Anyone know what that would be?

share|improve this question
up vote 5 down vote accepted

You could use a function inside your theme's functions file to selectively disable it for specific users.

function disable_bar_for_user( $ids ) {

    if( !is_user_logged_in() )

    global $current_user;

    if( is_numeric( $ids ) )
        $ids = (array) $ids;

    if( !in_array( $current_user->data->ID, $ids ) )

    add_filter( 'show_admin_bar', '__return_false', 9 );

Then call it for the user or users you want to disable the bar for..

Single user:


Multiple users:


If you want to just turn it off altogether, then the following should do it(instead of the function).

add_filter( 'show_admin_bar', '__return_false', 9 );

Hope that helps.. :)

share|improve this answer
As always. You Rock. Thanks again. – Scott B Mar 31 '11 at 3:10

For functions.php:

// Disable the Admin Bar for All

add_filter( 'show_admin_bar', '__return_false' );
share|improve this answer
+1 brilliant, thanks it really works!!! – enam Mar 29 '11 at 18:33
+1 for simplicity :-) – Scott B Mar 31 '11 at 3:11

I believe you can activate such a plugin sitewide - http://wordpress.org/extend/plugins/disable-admin-bar/

share|improve this answer

Simply set show_admin_bar filter to false in your functions.php.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.