Post Pic

How to remove WordPress 3.1 admin bar

WordPress 3.1 introduced a new feature: the admin bar. It is quite cool, but I’ve heard from many people who’d like to remove it. Here is a little recipe about how you can remove it.

Paste the following piece of code into your functions.php file, save it and goodbye admin bar.

wp_deregister_script('admin-bar');
wp_deregister_style('admin-bar');
remove_action('wp_footer','wp_admin_bar_render',1000);

Thanks to Specky Boy for the tip!

9 Responses

Jul 20 2011 13:58

Your solution leaves me with html margin top: 28px.
I think a better way to disable it would be:
function my_function_admin_bar(){
return false;
}
add_filter( ‘show_admin_bar’ , ‘my_function_admin_bar’);

Aug 01 2011 04:48

Yep, Ciprian’s solution works fine. I prefer it to the one you talk about.

Aug 14 2011 17:36

Or even more simple, just add to your function.php file:

add_filter(‘show_admin_bar’, ‘__return_false’);

Dec 31 2011 17:34

show_admin_bar( false ); in functions.php works fine.

http://codex.wordpress.org/Function_Reference/show_admin_bar

Feb 13 2012 07:54

Steven Gliebe Solution worked best :)

Feb 14 2012 13:53

Thnak’s Steven

Feb 24 2012 11:19

The main problem (for me) with Jean-Baptiste code is that it disables Admin Bar into the backoffice too =( (I have no 20px margin)

Mar 03 2012 09:07

Insert show_admin_bar( false ); to functions.php is another way.

Jan 15 2013 22:44

show_admin_bar( false ); is the best way as shown in the codex page

Trackbacks:

Leave a Comment

* Name, Email, Comment are Required

WP Theme of the week

Sponsored Likebox