Sunday, November 21, 2010

Disable the admin bar in WordPress 3.1

One of the new features in WordPress 3.1 is the Admin Bar. It will automatically on by default.



To disable the admin bar, append the following code into functions.php file.
 <?php  
 /* Disable the Admin Bar. */  
 remove_action( 'init', 'wp_admin_bar_init' );  
 ?>  
The functions.php file is located inside the theme directory. You need to create one, if it does not exists yet.

2 comments :

  1. Also add `add_filter('show_admin_bar', function() { return false; });`

    ReplyDelete
  2. Also add add_filter('show_admin_bar', function() { return false; });

    ReplyDelete