How to Hide WordPress Admin Bar

Updated on December 19, 2024 by Editorial Team

Want to have more granular control over user access and permissions on your WordPress site? A great starting point is learning how to hide the WordPress Admin Bar.

The WordPress admin bar toolbar provides convenient access to key administrative functions and content creation tools. However, it can sometimes get in the way of your design workflow by hiding elements of your website during the editing process. 

More importantly, it can become a security vulnerability if unauthorized users gain access to functionalities they shouldn’t.

Fortunately, WordPress offers the flexibility to address this. You can choose to hide the admin bar entirely or selectively based on user roles. 

This article outlines proven methods to disable the WordPress admin bar to improve your editing experience and website security.

Table Of Content

What is the WordPress Admin Bar? 

The WordPress Admin Bar is a floating toolbar that appears at the top of your website. It is essentially a shortcut menu for managing your site. 

It provides quick and easy access to frequently used tools and features and allows you to perform tasks without navigating to the full dashboard.

With the Admin Bar, you can add new posts or pages, moderate comments, access your site’s settings menu, and much more, all from the front end of your website. 

It gives you direct access to elements such as your dashboard, media library, plugins, themes, user profiles, and other quick links.

The Admin Bar is customizable. You can add or remove elements to suit your editing style. 

Some WordPress plugins also extend their functionality by adding their own elements to the bar. 

Why Hide the Admin Bar? 

Here are some reasons to hide your WordPress admin bar and improve overall website functionality.

Admin bar 2 how to hide wordpress admin bar from the plus addons for elementor
  1. Cleaner Design Preview: The Admin Bar can overlap design elements on your website. This can make it difficult to accurately preview the page. Hiding the admin bar provides a clear and unobstructed view of your site’s design.
  2. Enhanced Security:  For users with limited permissions (like subscribers), the Admin Bar exposes functionalities they shouldn’t access. Hiding it reduces potential security risks and prevents accidental changes to your website.
  3. Improve Functionality:  The persistent bar at the top can sometimes obstruct key website elements for logged-in users. It might cover up your navigation menu, search bar, or other interactive features. Hiding it creates a more focused experience.
  4. Control User Access: Hiding the Admin Bar can be a strategic way to manage user roles and permissions. By restricting access to certain functionalities, you maintain better control over who can make changes to your website.

How to Hide WordPress Admin Bar [Working Methods]

Let’s now look at easy methods to Hide the WP admin bar. 

Before trying any of these methods, backup your website to keep your content and customizations safe. You can use a WordPress Backup Plugin to do this quickly. 

Method 1 – Using PHP Code

The first way you can remove the WordPress admin bar is by adding a PHP code to your WordPress Theme File. The Theme File is a document containing the PHP code that controls various aspects of your theme’s behavior. 

Now, from your WordPress admin dashboard, navigate to Appearance > Theme File Editor. From the Theme Files menu on the right, select the functions.php file.

Theme file editor 2 how to hide wordpress admin bar from the plus addons for elementor

There are two ways you can go about it: 

  • To hide the admin bar for all users 

You can hide the admin toolbar for all users by adding the following PHP code snippet at the bottom of the file before the ?> closing tag in the code editor screen.

Hide the admin bar how to hide wordpress admin bar from the plus addons for elementor

Once done, click Update File. 

  • To hide the admin bar for specific roles 

You can disable it for specific user roles to gain more control over who has access to the admin bar. To do this, add the snippet below: 

Note: If you have a custom code PHP for your theme, before proceeding with this method create a child theme to keep the custom PHP intact even after the update. 

Method 2 – Through User Permissions in WordPress Dashboard 

You can control who has quick access to the admin toolbar through the dashboard. 

Navigate to your WordPress dashboard and then to Users > All Users

Then, click Edit under the user whose permissions you want to alter. Scroll down to find the Toolbar checkbox and uncheck it to hide it from non-admin users. 

Wordpress dashboard how to hide wordpress admin bar from the plus addons for elementor

This method requires individual changes to each user’s permission. It is great if you have only a handful of users. However, it might be tedious to edit user permissions individually for larger website management teams. 

Method 3 – Using a Free Plugin 

Using a plugin such as Hide Admin Bar Based on User Roles plugin is a good solution if method 1 and method 2 do not work for you. 

Method 1 is a code-based solutions whereas method 2 can be time consuming if you have a large theme. The plugin options gives you a perfect in between by allowing you change permissions in bulk without having to code. 

From your WordPress dashboard, navigate to Plugins > Add New Plugin. In the search bar, look up “Hide Admin Bar Based on User Roles.” Once you find the plugin, Install and Activate it.  

Free plugin how to hide wordpress admin bar from the plus addons for elementor

When the plugin is up and running, head to Settings > Hide Admin Bar Settings

Now, you can edit permissions by checking the appropriate checkboxes. You can hide the admin bar for all users or specifically for different user roles. You can also hide it for guest users and blacklist certain user capabilities. 

Hide admin bar settings how to hide wordpress admin bar from the plus addons for elementor
20 checklist for wordpress site maintenance how to hide wordpress admin bar from the plus addons for elementor
Do you Manage WordPress Websites? Download Our FREE E-Book of 20+ Checklist for WordPress Site Maintenance. ​



    Wrapping Up 

    You can use the methods outlined in this article to hide your WordPress admin toolbar to control access, enhance your website’s appearance, and improve user experience. 

    However, before implementing these methods, make sure you have a backup of your website and understand the implications for different user roles. 

    To supercharge your website with advanced functionalities and attractive visual elements, consider The Plus Addons for Elementor. This plugin offers a vast library of more than 120 widgets and extensions, allowing you to create dynamic and engaging website designs with ease. 

    Check out the Complete List of 120+ Widgets and Extensions here. Start building your dream website without coding!

    Whether it’s to build advanced carousels, eye-catching animations, or custom forms, The Plus Addons for Elementor has got you covered!

    FAQs on Hiding WordPress Admin Bar

    Does hiding the admin bar affect website performance?

    Hiding the admin bar does not impact website performance. The resources used to load the admin bar are relatively small. Hiding it might lead to a tiny improvement in page load speed, but it’s unlikely to be noticeable. 

    Is it safe to hide the admin bar?

    Yes, hiding the admin bar is safe. Hiding it doesn’t disable core WordPress functions or make your site vulnerable. However, back up your website beforehand, and consider the impact on different user roles. For example, editors might need access to the admin toolbar to easily edit your website’s look and functionality. 

    How do I hide the admin bar on the front end of my WordPress site?

    You can hide the admin bar from the front end by hiding it from all user roles by adding code to your theme’s functions.php file. You can use a dedicated plugin designed for this purpose. You can also use user profiles through the Dashboard and uncheck the “Show Toolbar when viewing site” option. 

    Can I disable the WordPress admin bar for specific roles?

    Yes, you can disable the admin bar for specific user roles. This can be achieved by modifying the code in your theme’s functions.php file to target specific roles. You can use a plugin to hide the toolbar with a role-based visibility settings menu. 

    Why is my WordPress toolbar not showing?

    If your WordPress toolbar isn’t showing, it might be due to hidden toolbar settings in your profile, a theme or plugin conflict, or caching issues displaying an outdated site version. Try checking your profile settings and user permissions, deactivating plugins, or clearing your browser cache to resolve the issue.

    What are the benefits of hiding the WordPress admin bar?

    Hiding the WordPress admin bar provides a cleaner preview of your website’s design and frees it from distractions. It enhances security by restricting access to sensitive functions for non-admin users. It also improves the user experience by removing visual clutter and allows for a more efficient and professional website design experience.

    How do I re-enable the WordPress admin bar after hiding it?

    To re-enable the admin bar, remove the code you added to your theme’s functions.php file, deactivate the admin bar hiding plugin, or re-check the “Show Toolbar when viewing site” option in your user profile settings through your WordPress dashboard, depending on the method you used to hide it.