How to Hide WordPress Admin Bar: Complete Guide

If you’ve ever logged into your WordPress site and found the admin bar at the top of the screen a bit distracting, you’re not alone. While this toolbar can be helpful for quickly accessing different parts of your site, it’s not always something you want to see.

Whether you’re looking to hide the WordPress admin bar for all users, a specific user, certain user roles, or make it visible only for administrators, WordPress gives you the flexibility to manage who sees it.

In this guide, we’ll walk you through how professional WordPress developers hide the admin bar based on specific needs from all users to just a few. Let’s get started and tidy up your WordPress interface!

Why Hide the WordPress Admin Bar?

The admin bar in WordPress serves as a handy tool for users who frequently manage their site. However, it’s not always necessary for everyone.

Depending on your role or how you prefer to work, hiding the admin bar might actually improve your experience.

Here are some reasons why you might want to consider hiding it:

  • Cleaner Workspace: For users who prefer a simple, clutter-free workspace, the admin bar can feel intrusive. By hiding it, you can enjoy a more minimal interface, which can help keep your focus on the tasks at hand.
  • Faster Page Load Times: On sites with lots of plugins or heavy customizations, the admin bar might contribute to slower page loads. Hiding it can help improve performance, especially when working on content-heavy sites.
  • Less Distraction for Non-Admins: For users like contributors or editors who don’t need all the admin tools, the admin bar can be more of a distraction than a help. Removing it can streamline their experience and keep them focused on their work.
  • Redundant Features: Many of the shortcuts in the admin bar are already available in other parts of the WordPress dashboard. If you’re comfortable navigating the backend, the admin bar can feel redundant.
  • Simplicity for Beginners: For users new to WordPress, the admin bar can be overwhelming. Hiding it might reduce confusion and create a smoother learning curve.

By hiding the admin bar, you can create a more personalized and efficient environment for yourself and your team.

How to Hide WordPress Admin Bar

There are a few easy ways to hide the WordPress admin bar. Whether you want a quick solution or a more flexible approach, we’ve got you covered.

But first, here’s a quick tip: always backup your website before making any changes. Whether you’re installing a plugin or tweaking settings, it’s always a good idea to have a backup. That way, if anything goes wrong, you can restore your site in no time. You can also try making these changes on a staging site so you don’t risk affecting your live site.

Now, let’s get started.

Hiding the Admin Bar for All Users

If you want to hide the admin bar for everyone on your site, whether for simplicity or aesthetic reasons, there are two easy ways to do it: using a plugin or adding a custom code.

Using a Plugin

The quickest and easiest way to hide the admin bar for all users is by using a plugin. Here’s how:

How to Hide WordPress Admin Bar 1
  • Select Admin Interface and enable the Hide Admin Bar option.
  • Expand the section and check all the user roles you want to hide the admin bar for (this can be everyone from administrators to subscribers).
  • Once you’ve made your selections, click Save Changes.

And that’s it! The admin bar will no longer appear for any user roles you selected.

Using Code

If you’re comfortable with a little coding, you can hide the admin bar by adding a code snippet to your site. Here’s how:

  • First, install and activate the Code Snippets plugin.
  • Go to Snippets → Add New in your WordPress dashboard.
  • Insert the following code snippet:
/* Disable WordPress Admin Bar for all users */
add_filter( 'show_admin_bar', '__return_false' );
How to Hide WordPress Admin Bar 2
  • Click Save Changes.

Now, the admin bar will be hidden for all users, both in the dashboard and on the front end. You can check this by visiting your site or logging in to the dashboard— and you’ll notice the admin bar is gone.

Hiding the Admin Bar for a Specific User

If you only want to hide the admin bar for specific users rather than everyone, this method is super simple.

  • Go to Users → All Users in your dashboard.
  • Select the user for whom you want to hide the admin bar.
How to Hide WordPress Admin Bar 3
  • Scroll down to the Toolbar section and uncheck the box that says Show Toolbar when viewing the site.
  • Click Save Changes.

Now, the admin bar will be hidden only for that specific user. This is a great way to customize the experience for contributors, editors, or other WordPress user roles without impacting everyone else.

Looking for advanced WordPress customizations?

Hiding the Admin Bar for a User Role

Sometimes, certain user roles (like subscribers, customers, or contributors) don’t need access to the WordPress admin bar. You can hide it based on specific user roles to keep their experience simple and focused.

Using a Plugin

Using a plugin is the easiest way to hide the admin bar for specific user roles.

  • Install and activate the Admin and Site Enhancements plugin.
  • Go to Tools → Enhancements in your dashboard.
  • In the Admin Interface section, enable the Hide Admin Bar option.
How to Hide WordPress Admin Bar 4
  • Expand the options and select the user roles you want to hide the admin bar for (e.g., customers, subscribers).
  • Click Save Changes.

And that’s it! The admin bar will no longer show up for the selected user roles.

Using Code

If you prefer a more hands-on approach, you can hide the admin bar for certain roles by adding a code snippet. Here’s how:

  • Install and activate the Code Snippets plugin.
  • Go to Snippets → Add New.
  • Paste the following code into the editor:
function check_current_user_role( $roles ) {
    if ( is_user_logged_in() ) :
        $user = wp_get_current_user();
        $currentUserRoles = $user->roles;
        $isMatching = array_intersect( $currentUserRoles, $roles);
        return !empty($isMatching);
    endif;
    return false;
}

$roles = [ 'customer', 'subscriber' ];

if ( check_current_user_role($roles) ) :
    add_filter('show_admin_bar', '__return_false');
endif;
How to Hide WordPress Admin Bar 5
  • Replace ‘customer’ and ‘subscriber’ with the user roles you want to hide the admin bar for.
  • Click Save Changes.

Now, the admin bar will be hidden for the selected user roles, leaving everyone else unaffected. And if you are not good at coding, hiring WordPress developers is always a good idea.

Hiding the Admin Bar for All Users Except Administrators

Administrators are usually the ones who need quick access to various settings and features on a WordPress site. So, if you want to hide the admin bar for everyone except admins, here’s how to do it.

Using a Plugin

This is a simple option with the same plugin.

  • Go to Tools → Enhancements in your dashboard.
  • In the Admin Interface section, enable the Hide Admin Bar option.
How to Hide WordPress Admin Bar 6
  • Select all the user roles except Administrators.
  • Click Save Changes.

Now, the admin bar will be hidden for everyone except administrators, who can continue using it as usual.

Using Code

If you prefer a code-based solution, you can hide the admin bar for all non-admin users by following these steps:

  • Install and activate the Code Snippets plugin.
  • Go to Snippets → Add New.
  • Add this code to the editor:
add_action('after_setup_theme', 'remove_admin_bar');

function remove_admin_bar() {
    if (!current_user_can('administrator') && !is_admin()) {
        show_admin_bar(false);
    }
}
How to Hide WordPress Admin Bar 7
  • Click Save Changes.

This code ensures only administrators can see the admin bar, while all other user roles will have it hidden when they log in.

FAQs on Hiding WordPress Admin Bar

Do I need the WordPress admin bar?
It really depends on how you use your WordPress site. The admin bar is helpful if you frequently need to make quick edits or access your dashboard tools without going into the backend. However, if you’re not using these features, you might not need it.
Will hiding the admin bar affect my WordPress site?
No, hiding the admin bar won’t affect the functionality of your WordPress site. It simply removes the bar from view without changing any other settings or performance aspects. Plus, if you ever want to bring it back, you can easily reverse the change. Just make sure to back up your site before making any adjustments, especially if you’re using code or plugins.
Can I hide the admin bar temporarily and restore it later?
Yes, you can hide the admin bar temporarily and bring it back whenever you need. If you’ve hidden it using user settings, simply re-enable the toolbar in the user profile section. If you used a plugin, just deactivate or uninstall it to restore the admin bar. It’s a flexible feature that you can turn on and off as needed without much hassle.

Conclusion

Deciding whether to hide the WordPress admin bar depends on how you and your team use the site. If you want to keep things clean for certain user roles like subscribers or contributors, or if you find the admin bar distracting, hiding it can make a big difference.

Whether you prefer using a simple plugin or adding custom code, WordPress makes it easy to control who sees the admin bar. And you can always revert these changes.

By tweaking these settings, you can offer a more focused experience for users who don’t need full access to the dashboard while keeping things efficient for yourself and other administrators. And if you’re not comfortable making these changes yourself, expert WordPress developers can easily handle this and other customizations for you.

Need help with WordPress tweaks?

author
Mehul Patel is a seasoned IT Engineer with expertise as a WordPress Developer. With a strong background in Core PHP and WordPress, he has excelled in website development, theme customization, and plugin development.

Leave a comment