The default setting of WordPress shows an admin bar on the front-end. It will show up when you view your website in the logged in status. If you don’t like it, this post will show you to hide the admin bar in WordPress.
While the feature is useful enough as it offers quick access over a certain action (e.g., content editing), you might find it annoying.
In this post, I will show you how to hide the WordPress bar with a no-plugin approach.
Shortcuts โคต๏ธ
- When should you hide the admin bar?
- Hiding the admin bar using WordPress built-in setting
- Hiding the admin bar from multiple users by user role
- Summary
When Should Hide the Admin Bar?
As mentioned above, the admin bar offers quick access over certain actions in WordPress. For instance, you can quickly edit a post without needing to switch back to the WordPress dashboard first.
Or if you are a Google Site Kit user, you can quickly learn the performance of a particular post on Google Search by hovering your cursor over the Site Kit menu.

But again. Not everyone is really impressed by the admin bar. Instead, some WordPress users find it annoying.
Also, showing up the admin bar is not a good practice if you run a certain website type.
Like what?
Say you are running a membership website. You definitely don’t want your users to see the admin bar. Don’t you?
Although some membership plugins have a setting option to disable the WordPress admin bar, some don’t have one. In the latter case, you can hide the admin bar yourself.
Hiding WordPress Admin Bar without a Plugin
As I mentioned above, this post will show you how to hide the WordPress admin bar without involving a plugin.
Instead, I will show you how to hide the admin bar using the built-in WordPress setting and using custom code.
1. How to the Hide Admin Bar Using WordPress Built-in Setting
Every user on a WordPress website has access to the user setting whereby they can set things like nickname, profile picture, password and so on. You can go to Users -> Profile on the WordPress dashboard to access these settings.
From here (Profile screen), you can also find a setting option to show/hide the admin bar from the front-end.
To hide the admin bar from the front-end, you can simply uncheck the Show Toolbar when viewing site option.

Don’t forget to click the Update Profile button at the bottom to apply the change.
Please note that the above steps only hide the admin bar for indivual user. If you want to hide the admin bar for multiple users on your WordPress wesbite, you can use the other options below.
2. How to Hide the Admin Bar from Multiple Users by User Role
If you want to hide the admin bar for multiple users, then the user role parameter can be a great idea.
For instance, you can hide the admin bar for all users with the role of subscriber.
Since you don’t want to use a plugin, the only way to achieve this is by using a custom function. To add a custom function itself, you need to edit the functions.php file of your theme.
Or you can also create a custom plugin dedicated to hosting custom functions. I have published a post about how to add a custom function in WordPress you might want to read.
For this example, I will show you how to add custom function by editing the functions.php file.
From your WordPress dashboard, go to Appearance -> Theme File Editor. If you are a block theme user, you can find the Theme File Editor under the Tools menu.

๐ Some security plugins disable Theme File Editor for a security reason.
Select the functions.php file on the right panel to edit it.

Paste the following code right after the last line of the file and click the Update File button.

The code:
function check_current_user_role( $roles ) {
if ( is_user_logged_in() ) :
$user = wp_get_current_user();
$currentUserRoles = $user->roles;
$isMatching = array_intersect( $currentUserRoles, $roles);
$response = false;
if ( !empty($isMatching) ) :
$response = true;
endif;
return $response;
endif;
}
$roles = [ 'customer', 'subscriber' ];
if ( check_current_user_role($roles) ) :
add_filter('show_admin_bar', '__return_false');
endif;
The above code will hide the admin bar from all users with the role of customer and subscriber. You can add more user roles by editing the following line.
$roles = [ 'customer', 'subscriber' ];
Use a comma to separate the user roles. For instance, if you want to add contributor, the line should be like this:
$roles = [ 'customer', 'subscriber','contributor' ];
Done!
The admin bar should now disappear when a user with one of the above roles is viewing your website.
Summary
The admin bar is a useful feature in WordPress. It offers quick access to some administrative tasks. Such as editing content, adding new content, managing comments and so on.
If you find it annoying, WordPress offers a built-in setting option to hide it. Unfortunately, the built-in setting works only for individual user.
If you want to hide the admin bar from multiple users at once, you can use the custom function I provided above.
If you have never edited the functions.php file before, it’s strongly recommended to make the backup of the file first first just in case everything doesn’t work the way you expect.