follow mejoin mesubscribe

Disable the WordPress 3.1 Admin Bar

The WordPress Admin Bar may be useful but has the potential to disrupt the frontend display of your site while logged in if you are using a background image. To disable the WordPress Admin Bar which is a new feature in WordPress 3.1, place this code in your theme functions.php file.

This code snippet does 2 things:

  1. Disables the Admin Bar
  2. Removes the Admin Bar user options from the edit user profile page
/**
 * Remove WordPress 3.1 Admin Bar and User Options
 *
 * @author Jen Baumann
 * @link http://dreamwhisperdesigns.com/?p=439
 */

if ( function_exists( 'show_admin_bar' )  ) {
	remove_action( 'personal_options', '_admin_bar_preferences' ); 
	add_filter( 'show_admin_bar', '__return_false' );
}

Update: The final release of WordPress 3.1 provided user profile options for the adminbar and fixed potential site layout issues.

Read my Genesis tutorials at StudioPress.

About Jennifer Baumann

I am an avid horseback rider, animal lover, and freelance designer. I love working with WordPress and Genesis and work for Copyblogger Media as a Technical Support Advocate.

Dream Whisper Designs is Powered by Genesis

StudioPress Premium WordPress Themes

Genesis empowers you to quickly and easily build incredible websites with WordPress. Whether you're a novice or advanced developer, Genesis provides the secure and search-engine-optimized foundation that takes WordPress to places you never thought it could go. It's that simple - start using Genesis now!

Take advantage of the 6 default layout options, comprehensive SEO settings, rock-solid security, flexible theme options, cool custom widgets, custom design hooks, and a huge selection of child themes ("skins") that make your site look the way you want it to. With automatic theme updates and world-class support included, Genesis is the smart choice for your WordPress website or blog.