How to Hide WordPress Admin Bar?

by

How To Hide WordPress Admin Bar

Has the ever-present WordPress Admin Bar got you pulling your hair? 

GIF showing annoyance

Wondering how to easily disable the admin bar? 

Well, you are at the right place!

Recently, we had to hide WordPress Admin Bar. We tried and tested nearly 20 different ways to do this!

In this article, you will learn how to remove the WordPress admin bar.

Pro tip: To know the step-by-step process to hide the WordPress Admin Bar, skip to this section below

What is the WordPress Admin Bar? 

The Admin Bar is like your website’s very own WordPress speed-dial! 

Let me explain.

The Admin Bar is a 32px long toolbar that is displayed at the top of your WordPress Admin Dashboard. If you’re logged in, it also appears on your website’s frontend.

Now imagine this. You’ve spent 36 hours on a design binge. You’re down to your last “reasonable” cup of coffee. And then you realise all your work is messed up because of one bar hovering on top.

How ticked off would you be?

Here’s the thing though. 

The WordPress Admin bar contains shortcuts to functions primarily accessible from your dashboard. Just like a speed-dial, you can add your favourite functions to the Admin Bar. This enables you to reduce navigating between your dashboard and Website.

For example, if you’re using the Divi Theme, you can easily add a widget to it on the Admin Bar. Now instead of going to the dashboard to make design changes, you can directly access the theme from the Admin bar.

So, if it’s that useful, why would you want to get rid of it?

That’s up next!

Why Would You Want To Hide The Admin Bar?

There are two main reasons why one may want to remove or hide the Admin Bar.

  • To restrict unnecessary access to your WordPress Admin Dashboard and keep it private
  • To get a more holistic view of your website design 

Nodding your head in agreement? 

Good!

Here are our top 3 ways to hide the Admin Bar and they all take <1 minute to execute! 

How To Hide WordPress Admin Bar Using The WordPress Dashboard

Let’s start with something simple.

The easiest way to remove the WordPress Admin Bar is by disabling it from your WordPress Dashboard! 

Here’s how: 

1. Hover on the “Howdy, (your name) section on the top RHS. Click on “Edit Profile”

Edit My Profile option from the WordPress Admin Bar

2. You can see an option called “Toolbar – Show Toolbar when viewing site”. By default, this is enabled for all users. Disable this by clicking on the box.

Show Tool Bar when viewing site option

3. Now scroll down and click on “Update Profile”

Update Profile Button

The WordPress Admin Bar will no longer be displayed on the frontend for any users.

How to Hide WordPress Admin Bar Using a WordPress Plugin?

There are more than 15 plugins on the WordPress Repository whose sole function is to hide the Admin Bar. Having tested them all out, we found the Hide Admin Bar plugin to be the best. It has more than 40,000 downloads and is truly a one-step solution!

All you have to do is install and activate the plugin onto your WordPress site. And voila! The Admin Bar is no longer visible when anyone visits your site. You can simply deactivate the plugin to get the Admin Bar back.

Hide Admin Bar Plugin in WordPress Repository


Another useful plugin is the Better Admin Bar plugin. Once you install and activate it, you can choose from the following options:

  • Hide the Admin Bar for all users 
  • Hide the Admin Bar for all users except Admin 
  • Make the Admin Bar Opaque (you can also control the % of opacity) 
  • Hide the Admin Bar unless hovered on
Better Admin Bar Plugins options

We always admire a plugin that is easy to use and does it’s job well!

How to Hide WordPress Admin using Code?   

Most people don’t like having too many plugins installed. 

Not to worry! 

You can easily remove the admin bar by modifying the code in your functions.php file. 

Here’s what you have to do. 

1. Hover on Appearance from the WordPress Menu.
2. Choose the “Theme Editor” option. This will take you to the code of the theme.

Theme Editor from Appearance Menu

3. Now open the functions.php folder. It is usually located on the list titled “Theme Files” on the right hand side (see screenshot below).

Locating the functions.php file in Theme Editor

4. Add the following code in the functions.php folder.

add_filter(‘show_admin_bar’, ‘__return_false’);

5. Now scroll to the bottom and click on “Update File”.

The WordPress Admin Bar is now removed from the front end of your site! 

To undo this, you just have to remove the added code.

How to Hide WordPress Admin Bar for Specific User roles?

Now, you might not necessarily want to remove the admin bar for everyone. To maintain privacy, you might want to hide the WordPress Admin for specific user roles. 

Did You Know?: Commonly, the WordPress Admin Bar is hidden for all users except Admins. 

Let’s explore how you can do this. 

1. Using a plugin

  • Remember the Better Admin Bar I’d mentioned earlier? Go to it’s Settings and click on “Hide the Admin Bar for all users except Admin”.
Better Admin Bar plugin option
  • Scroll to the bottom and Click on “Save”. That’s it. The Admin Bar is now hidden for all users except Admins.

Also Read: ???? Guide on How to Secure WordPress Admin

2. By Modifying the Code:

  • Go to the functions.php folder via Theme Editor.
  • Add the following code:

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

  • Click on “Update File”. The Admin Bar is now hidden for all users except admins.

What Next?

One of the best things about WordPress being open source is it’s room for flexibility. It’s no surprise that there are so many ways to hide a simple toolbar!

We hope our article helped you identify and execute the best way to hide your Admin Bar. In case you ever wish to use the Admin Bar, simply retrace and undo your steps.

If you liked this article and work frequently with WordPress, check out the rest of our blog.

Our mission is to make WordPress work for your business. That’s why we create killer content on all things WordPress. We also happen to make a killer WordPress management tool called WPRemote.

Feel free to check that out as well!

Category:

You may also like


How can we help you?

If you’re worried that your website has been hacked, MalCare can help you quickly fix the issue and secure your site to prevent future hacks.

My site is hacked – Help me clean it

Clean your site with MalCare’s AntiVirus solution within minutes. It will remove all malware from your complete site. Guaranteed.

Secure my WordPress Site from hackers

MalCare’s 7-Layer Security Offers Complete Protection for Your Website. 300,000+ Websites Trust MalCare for Total Defence from Attacks.