royjemee

Royjemee

May 2, 2024

5 Min read

How to Hide Admin Bar in WordPress Sites with Plugin & code

The admin bar in WordPress is a toolbar that appears at the top of the screen when you are logged in to your WordPress website. It provides quick access to various administrative tasks and features, making it convenient for users to navigate and manage their websites. If you are wondering how to hide admin bar in WordPress, then this guideline is for you.

The admin bar typically includes links to the WordPress dashboard, the user's profile, the ability to add new posts or pages, and shortcuts for viewing the website or logging out. It also displays notifications and updates for plugins and themes.

Here is something that I like to mention before you jump into the coding. If you are someone who likes to have a personalized WordPress Dashboard not only the Admin bar, then you should check out the WP Adminify plugin.

Purpose and Functionality of the Admin bar

The admin bar serves as a handy tool for website administrators and editors, allowing them to perform essential tasks without having to navigate through multiple pages within the WordPress dashboard.

But keeping the admin bar for subscribers, and customers may not be a good idea. It can distract those users sometimes. A customized Admin bar can increase your brand awareness among your users too.

Also, when it comes to brand awareness, we can't deny the fact of a customized login page where you can add your logo, and custom background image, change the default login text, and customize error messages. Customizing the entire login page via code may seem complicated to you, that's why you can depend on Loginfy - Custom login page customizer Plugin.

Why users may want to hide the admin bar

While the admin bar offers convenience, some users may prefer to hide it for various reasons. For example, website owners who want to provide a more personalized experience for their users may choose to hide the admin bar to create a cleaner and more professional look for their website.

Additionally, some users may find the admin bar distracting or unnecessary for their specific workflow. As mentioned the subscribers and customers users before.

How to Hide Admin Bar in WordPress

We will discuss 3 different methods that will help you to hide the admin bar in WordPress. All methods may not be suitable for you, that's why you have to think which one is best for you. I will try my best to explain the methods in detail so that you can make your decision wisely.

Method 1: Using the WordPress Dashboard

WordPress provides a built-in option to hide the admin bar. Users can navigate to their profile settings and uncheck the "Show Toolbar when viewing site" option to hide the admin bar from their view. But this can be done from the user end. As an admin, you have nothing to do with this method.

If you are someone, who just want to hide the admin bar for your personal user, then you can follow this step to get a clean frontend preview of your website.

Method 2: Editing the Theme's Functions.php File

Users can add the following code to the theme's functions.php file to hide the admin bar. By adding a simple line of code, users can effectively remove the admin bar from their WordPress website.

/* Disable WordPress Admin Bar for all users */ add_filter( 'show_admin_bar', '__return_false' );

This code will remove the admin bar for all users including admin. But if you want to hide the admin bar based on specific user role, you can use the following code.

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');

The above code will hide the admin bar for Editor, Author, & Subscriber user role. Just modify the code based on your personalized needs and update your functions.php file.

Method 3: WordPress Plugins for Hiding the Admin Bar

There are several WordPress plugins available that allow users to hide the admin bar. These plugins offer a user-friendly interface and additional customization options for managing the admin bar's visibility.

Here I am going to present the Admin Bar Editor plugin, which offers a modern UI with a lot of features for free.

How to hide the Admin Bar

First download and install the Free Admin Bar Editor plugin. Then navigate to the "Adminbar Editor" option in your Dashboard menu. You will see the Backend and Frontend options inside the panel.

Admin Bar Editor Plugin
Hide Backend Admin bar Items

Just flip the switch of any specific admin bar items from the option panel like in the following video. Then save your settings. In this way, you can hide specific admin bar items in the backend of your Dashboard.

Also, if you expand any admin bar items in the option panel - you will see some options to rename, change icons, and hide the items for specific user roles too. In case you need to hide specific items for any specific user role - then just use this option like the following video.

Hide Frontend Admin bar Items

Now click on the "Frontend" option first. Just like the same way as "Backend" you can hide specific admin bar items for the frontend too. Also, expand any items and customize them for specific user roles too.

But here is an interesting option called "Disable Frontend Admin Bar" - When you enable this option, you will 2 other options called "Hide Admin Bar for All User" and "Hide Admin Bar for All Guests User". Just enable anyone which you prefer.

Here is another option called "Disabled For". You can dynamically hide the frontend admin bar for specific user roles by using this option.

Not only that but also you can target specific user names too - Just select the "user name" instead of "User role" in the option panel and you are ready to select the specific user name from your WordPress Dashboard.

That's not all. You can explore more features of this Admin Bar Editor plugin features and I think this plugin is more than enough for anyone who likes to personalize their default WordPress Admin Bar or toolbar.

Pros and Cons of Hiding the Admin Bar

Every action reacts. In this case, there is also some reaction to hiding the entire admin bar. Instead of hiding, you can use the Admin Bar Editor plugin to control your Admin bar items visibility for different user roles and dynamically hide the admin bar for specific user roles. Also, if necessary can create custom links in your Admin bar too.

Benefits of hiding the admin bar

  • Enhanced website aesthetics and user experience
  • Customization of the WordPress interface
  • Reduced distractions for users

Drawbacks of hiding the admin bar

  • Limited access to quick administrative tasks
  • Potential confusion for users accustomed to the admin bar
  • Additional steps required for accessing administrative features

Considerations for making a decision

When deciding whether to hide the admin bar, users should consider their website's specific needs and the preferences of their target audience. It's essential to weigh the benefits of a cleaner interface against the potential drawbacks of removing quick access to administrative tools.

Conclusion

In conclusion, hiding the admin bar in WordPress can be a practical way to customize the user experience and improve the aesthetics of a website.

Whether users choose to utilize built-in options, edit the theme's functions.php file, or employ a WordPress plugin, there are various methods available for managing the admin bar's visibility.

By carefully considering the pros and cons of hiding the admin bar, users can make an informed decision that aligns with their website's goals and the needs of their audience.

Ultimately, customizing the WordPress experience by hiding the admin bar can contribute to a more tailored and professional website interface.

Get notified before anyone

Never Miss and Update

Leave a Comment

Your email address will not be published

Coupons
icon

Navigate on your Dashboard faster with WP Spotlight!

Try It Now