7

I just updated one of my blogs to the new wordpress 3.1 and i need to hide the admin menu that shows up on top of the pages. How do i disable it ?

thanks

1

this is the simplest way. install showhide-adminbar. then all subscriber won't see the adminbar even they set to show it in viewing site.

http://wordpress.org/extend/plugins/showhide-adminbar/

| improve this answer | |
8

Go to Dashboard > Your Profile > Show Admin Bar and uncheck "when viewing site"

| improve this answer | |
  • 1
    Can it be turned off globally? I don't want new subscribers to get the bar. – wyrfel Feb 23 '11 at 22:43
  • 7
    @wyrfel - I found this. Add remove_action( 'init', 'wp_admin_bar_init' ); to your functions.php – eileencodes Feb 23 '11 at 22:47
  • +1 - Been holding onto that one liner since i read about the admin bar going into 3.1, i've hated the damn thing since i saw it appear on wordpress.com blogs. – t31os Feb 24 '11 at 1:06
  • Cool thanks, I need to disable it for all new users on a site where i'm using the p2 (twitter style theme) – sebastienb Feb 24 '11 at 22:48
  • 1
    Actually it turns out you shouldn't remove the init action to get rid of the admin bar (a filter on show_admin_bar is the correct way to do it). – t31os Mar 10 '11 at 12:25
6

This would hide the Admin Bar for all users except Administrators. Add at end of functions.php:

function my_function_admin_bar($content) {
    return ( current_user_can("administrator") ) ? $content : false;
}
add_filter( 'show_admin_bar' , 'my_function_admin_bar');
| improve this answer | |
5

Add the following to your theme's functions.php file:

// Disable Admin Bar for all users
add_filter('show_admin_bar', '__return_false');

// Remove Admin Bar Options from all users' Profile page
add_action('admin_print_scripts-profile.php', 'hide_admin_bar_prefs');
function hide_admin_bar_prefs() {

?>
<style type="text/css">
    .show-admin-bar { display: none; }
</style>
<?php

}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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