Blog

How To Remove Or Disable The WordPress Admin Bar In WordPress 3.1

How To Remove Or Disable The WordPress Admin Bar In WordPress 3.1

This tutorial will show you several approaches explaining how to remove or disable the wordpress admin bar which was introduced in v3.1 of wordpress. The new admin bar feature displays a bar at the top of each page (see above image) when your are logged into your wordpress site, some people like it others don’t as always though wordpress can easily be customized to suit you preference of displaying or not displaying the admin bar.

The first approach you can use to disable the wordpress admin bar is by using a plugin, the Disable Admin Bar plugin which is available for wordpress is specifically coded for this task.

WordPress Disable Admin Bar Plugin

Disable the Admin Bar that now appears on the public side of WordPress blogs.

For a hassle free integration, drop the plugin file into wp-content/mu-plugins (create the directory if needed) and it will be automatically activated.

Download Disable Admin Bar Plugin

Manually Remove Disable WordPress Admin Bar

To manually remove the admin bar in wordpress by usuing the filter show_admin_bar you will need to edit your themes functions.php with the code snippet below that suits your requirements.

This code will completley disable display of the Admin Bar for everyone.

remove_action('init', 'wp_admin_bar_init');

This code would turn the display status of the Admin Bar to off.

function my_function_admin_bar(){
    return false;
}
add_filter( 'show_admin_bar' , 'my_function_admin_bar');

This would hide the Admin Bar for all users except Administrators.

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

Leave a Reply

Your email address will not be published. Required fields are marked *

*

*