How to disable the WordPress Admin Bar

The WordPress admin bar is the gray bar located at the top of your WordPress website. The WordPress admin bar includes various options and quick access to your WordPress dashboard or webpage.

Some WordPress users may want to disable or hide the WordPress admin bar so we have compiled a list of six different ways to do so. The options include CSS and PHP snippets, as well as using a WordPress plugin or the built in feature to disable the admin bar for specific users.

1. The first option includes copying and pasting the css snippet below and inserting it into your custom.css file or your primary css style sheet.

Enter this code into your current theme’s custom.css or style.css file to disable the admin bar:

#wpadminbar { display:none !important;}

2. The second option includes copying and pasting the php snippet below and inserting it into your functions.php file.

Enter this code into your current theme’s functions.php file to disable the admin bar:

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

3. The third option includes copying and pasting the php snippet below and inserting it into your functions.php file.

Enter this code into your current theme’s functions.php file to disable the admin bar:

add_filter( 'show_admin_bar', '__return_false' );

4. The fourth option makes the WordPress admin bar only visible to your Admin accounts.

Enter this code into your current theme’s functions.php file:

if (!current_user_can('manage_options')) {
add_filter('show_admin_bar', '__return_false');
}

5. The fifth option includes installing the free “disable admin bar” WordPress plugin.

Follow the link below for the WordPress plugin directory page:

6. The sixth option is standard in WordPress and will hide the toolbar when viewing your website.

Access a WordPress user profile you would like to disable the admin bar for and un-check Show Toolbar when viewing site.

WordPress Show toolbar option

Sean Doyle

Sean is a distinguished tech author and entrepreneur with over 20 years of extensive experience in cybersecurity, privacy, malware, Google Analytics, online marketing, and various other tech domains. His expertise and contributions to the industry have been recognized in numerous esteemed publications. Sean is widely acclaimed for his sharp intellect and innovative insights, solidifying his reputation as a leading figure in the tech community. His work not only advances the field but also helps businesses and individuals navigate the complexities of the digital world.

15 Responses

  1. Purnima Gore says:

    thank you for that. I was finding it really irritating to see the tool bar and your option 1 worked perfectly. Cheers

  2. twitter_DavidEnglewood says:

    Disable #WordPress Admin bar (Thanks Botcrawl.com)

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.