Controlling the visibility of the WordPress admin bar helps create a personalized workspace. It surely improves the overall user experience as well.
Whether you want to streamline the interface for certain user roles or hide it from specific users, customizing the admin bar can significantly enhance usability.
If you want to make the admin bar user friendly by hiding it for user roles customization is your only choice. While you can also hide it for specific users to make it further optimized, but by default you don’t have the option to do so.
Today I’m going to show you how to hide the WordPress admin bar based on user roles or specific users. I’ll explain everything step by step. So it’ll be easy to follow for everyone.
Why Should You Hide the Admin Bar?
The admin bar is an interesting and helpful option for WordPress site owners. You can use it for adding content, changing settings or something else. Also, you can get very basic role based control.
But if you want advanced role based control or provide less access to other roles, you should hide the admin bar. You can do to to take extra precautionary measure.
Here are a few reasons why you should hide the admin bar in WordPress:
- Messy Dashboard Interface: The default admin bar can make the interface look messy and confusing. If you prefer a clean dashboard, this surely is distracting.
- Performance Issues: Websites with a large number of plugins, the admin bar can slow down page load times. This is frustrating for users trying to manage their sites efficiently.
- User Confusion: For beginners, the admin bar might be confusing. They might not understand what each icon and link does. So, it creates major confusion among them.
- Limited Use for Certain Roles: Default roles like editors or contributors offer features that are irrelevant to their tasks. This makes it useless for their specific needs.
How to Hide WordPress Admin Bar Based On User Roles or Specific Users using a Plugin
You can easily hide the admin bar in WordPress using plugins. With additional customization option the Admin Bar Editor gives you such flexibility free of cost.
Here’s how to hide the admin bar based on user roles or specific users using the Admin Bar Editor plugin.
Step 1: Install the Admin Bar Editor Plugin
Download, Install, Activate: Start by downloading and installing the free Admin Bar Editor plugin from the WordPress plugin repository. You can directly download the plugin here.

Once installed, activate the plugin.
Step 2: Access the Admin Bar Editor
Go to WordPress dashboard and find the “Admin bar Editor” option. Click on “Admin bar Editor” to open the panel.
Here you will find two options: Backend and Frontend.
Hide Backend Admin Bar Items
Toggle Visibility: In the Backend section, you will see a list of admin bar items with switches next to them. Flip the switch of any item you want to hide.
Save Settings: After selecting the items to hide, save your settings.

Additional Customization:
Expand Items: Click on any item to expand it. Now, you can rename items, change icons and set visibility based on user roles.
User Role Customization: You can hide items for specific user roles. Just use the provided options to set these preferences.
Hide Frontend Admin Bar Items
Click on the “Front end” tab in the Admin bar Editor panel.
Just like the Backend section, flip the switches for any items you want to hide on the frontend.

Disable Frontend Admin Bar:
Enable the “Disable Front end Admin Bar” option. Now two options will appear: “Hide Admin Bar for All Users” and “Hide Admin Bar for All Guest Users.”
The name itself describe what it does so, you do what you need to do.
Dynamic Hiding:
Use the “Disabled For” option below to hide the admin bar for specific user roles dynamically.
You can also hide the admin bar for specific usernames by selecting “user name” instead and choosing the desired usernames.

Hide Admin Bar Based On User Roles
Now, time to hide the admin bar for specific user roles. Add the following code to your theme’s functions.php
file:
function hide_admin_bar_based_on_role() { if (current_user_can('editor') || current_user_can('author') || current_user_can('subscriber')) { show_admin_bar(false); } } add_action('after_setup_theme', 'hide_admin_bar_based_on_role');
This code checks if the current user based on mentioned roles and hides the admin bar.
We know how important it is to manage role based visibility of the admin bar. But, so is the security of your WordPress dashboard.
We have shared a new article on: How WP-Admin Redirects to Homepage & Hide Login URL?. Here you can learn to to protect your site’s backend by redirecting the WP-Admin page to the homepage and hiding your login URL.
Hiding the Admin Bar for Specific Users
You can also hide the admin bar for specific users. All you need to do is use their user ID to do so. Here’s the code you can follow:
function hide_admin_bar_for_specific_users() { $user = wp_get_current_user(); if (in_array($user->ID, array(2, 4))) { // Replace 2, 4 with the user IDs you wish to hide the admin bar for show_admin_bar(false); } } add_action('after_setup_theme', 'hide_admin_bar_for_specific_users');
Note: Replace 2, 4
with the user IDs for whom you want to hide the admin bar.
Do You Know? You can optimize your WordPress dashboard by hiding default admin notices.
Check out How to Permanently Hide Admin Notice in WordPress?. In this article we shared a straightforward solution to keep your dashboard clean and distraction-free.
How to get the User ID?
Just navigate to the Users Page in your WordPress Dashboard. Hover on the “Edit” option for that user for whom you like to hide the admin bar. Take a look at the following screenshot and you will get the ID marked by an arrow sign.

Customizing the visibility of the admin bar based on user roles or specific users can greatly enhance the user experience on your WordPress site.
We have shared both methods with and without a plugin to do so. You can follow the mentioned code snippets if you’re comfortable with codes. But don’t forget to always back up your site before making changes to the code.
Otherwise, Admin Bar Editor helps you do it without messing with the codes. So, use it and enjoy the ultimate customization freedom for your WordPress dashboard!