blog

How to Hide the Admin Bar for Subscriber Users in WordPress

When you log into WordPress, you see the admin bar at the top of the screen. It’s useful for administrators, but not always for subscribers.

Sometimes, you don’t want your subscribers to see it. Maybe you want a cleaner look for your website. Or maybe you just want to keep them from accessing certain admin functions.

The good news? It’s easy to hide the admin bar for subscribers! Let’s go step by step.

Why Hide the Admin Bar?

The admin bar has shortcuts for dashboard access, editing, and more. But regular subscribers don’t need it.

Here are some reasons to remove it:

  • It clutters the user experience.
  • Subscribers don’t need admin access.
  • It helps keep your site looking neat.
  • You prevent accidental clicks that lead to the dashboard.

Now, let’s look at how to hide it.

Method 1: Using Code (Recommended)

If you like working with code, this is a simple and effective way!

Follow these steps:

  1. Go to your WordPress dashboard.
  2. Navigate to Appearance > Theme File Editor.
  3. Find and open the functions.php file.
  4. Add this code at the bottom:
<?php
add_action('after_setup_theme', function() {
    if (!current_user_can('edit_posts')) {
        show_admin_bar(false);
    }
});
?>

This code checks if the user can edit posts. If not, it hides the admin bar.

Save the file and refresh. Your subscribers will no longer see the admin bar!

Method 2: Using a Plugin

If coding isn’t your thing, don’t worry. There are plugins that can do this for you.

Here’s how:

  1. Go to Plugins > Add New.
  2. Search for Hide Admin Bar or a similar plugin.
  3. Install and activate the plugin.
  4. Follow the plugin settings to disable the admin bar for subscribers.
Soledad WordPress Themes

Plugins make things quick and easy. However, using too many plugins can slow down your website.

Method 3: Disabling via User Settings

Another way is to turn off the admin bar from user settings.

Follow these steps:

  1. Go to Users > All Users.
  2. Click on a subscriber’s name.
  3. Find the option Show Toolbar when viewing site.
  4. Uncheck it and click Update User.

The downside? You have to do this for each user manually.

Which Method Should You Choose?

Each method has its pros and cons.

  • If you like coding, use the functions.php method.
  • If you prefer an easy solution, use a plugin.
  • If you only have a few subscribers, update user settings manually.

Bonus: Hiding the Admin Bar with CSS

If for some reason the previous methods don’t work, you can use CSS.

Follow these steps:

  1. Go to Appearance > Customize > Additional CSS.
  2. Add this code:
.admin-bar {
    display: none !important;
}

Save the changes, and the admin bar will disappear! However, this method only hides the visual part—users can still access the dashboard.

GeneratePress WordPress Themes

Final Thoughts

Hiding the admin bar for subscriber users makes your site cleaner and more professional.

Now you know multiple ways to do it! Whether through code, plugins, user settings, or CSS, pick the method that best suits your needs.

Try it out today and give your subscribers a better browsing experience!