How to Remove the WordPress Admin Toolbar From Your Site

You know that annoying admin toolbar that WordPress displays at the top of your site when you log in? You log out and it is still there? Does it bother you as much as it bothers me? Want to remove it? If the answer is yes, then you are reading the right post.

How to remove wordpress admin toolbar
WordPress admin toolbar

You have a couple of ways of doing that. Here is what you do.

Turn Off the Admin Toolbar in Settings

How to remove admin toolbar from WordPress using settings
Remove the toolbar using the wordpress settings option

To remove the toolbar from your site, go to Users > Your Profile. Scroll down to “Toolbar” and check “Show Toolbar when viewing site.”

And that’s all you need to do. The Toolbar will no longer appear on your site.

While the toolbar will stop displaying on the front-end of your site, it will continue to show on the backend of your site. It’s best to leave the backend toolbar as it is – it does contain important information about your site, after all.

 

Remove the Admin Toolbar with Code

If you would rather remove the toolbar with code, just drop the following snippet into your functions.php file:

{code type=php}
add_filter(‘show_admin_bar’, ‘__return_false’);
{/code}

This code will stop the toolbar from displaying on the front-end of your site.

 

Disable Admin Bar for All Users Except for Administrators

Paste this code in your theme’s functions.php file

add_action('after_setup_theme', 'remove_admin_bar');
function remove_admin_bar() {
if (!current_user_can('administrator') && !is_admin()) {
  show_admin_bar(false);
}
}

Disable Admin Bar for All Users

If you want to disable it for all users, then simply put use this code in your theme’s functions.php file

/* Disable WordPress Admin Bar for all users but admins. */
show_admin_bar(false);

 

Remove Parts Of The WordPress Admin Bar

If you are looking for an easy solution to remove certain elements from the Toolbar you can do this using a code. First of all, you will need to search for the toolbar node ID for the element you want removed. You can find out more about this here.

For example, if you want to remove the WordPress logo from the toolbar use this code:

add_action( 'admin_bar_menu', 'remove_wp_logo', 999 );
function remove_wp_logo( $wp_admin_bar ) {
    $wp_admin_bar->remove_node( 'wp-logo' );
}

Disable The WordPress Admin Bar Using CSS

While the first method is without questions the easiest, this is a close second in terms of difficulty. You only have to copy and paste the CSS code below in Appearance > Customize > Additional CSS, or your style.css file.

The CSS code to disable the toolbar is:

#wpadminbar { display:none !important;}

Remove The WordPress Admin Bar Using A Plugin

While the solution above may be easy it isn’t the only way to remove the toolbar. You have a ton of plugins that are able to help you with the same problem. The most popular plugin is the Hide Admin Bar designed by Shelby DeNike.

All you need to do is download the plugin, active it and your toolbar will be gone.

On the other hand, if you want to hide the toolbar for some user roles, you should download the Admin Bar Disabler by Scot Kingsley Clack, instead. This plugin gives you an actual interface, where you can:

  • Blacklist the toolbar for certain users
  • Whitelist the toolbar for certain users
  • Disable the toolbar for everyone
 

That’s it! With any of these simple steps you can get rid of that pesky admin toolbar.

 

 

 

 

Deje un comentario

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

en_US