How to Disable WordPress Admin Bar for All Users Except Admins

Need to know how to disable the admin bar in WordPress? Of course, you can without much of a stretch disable the WordPress admin bar for every user from the dashboard. However, if you have a great deal of registered users on your site, this method might take time. In this article, we will show you how to disable WordPress Admin bar for all users except admins.

How to Disable WordPress Admin Bar for All Users Except Admins

As a matter of course, WordPress displays an admin bar at the top for all signed-in users. This toolbar is visible while logging in to the WordPress admin region as well as other pages. The WordPress admin toolbar contains useful alternate ways for different areas of WordPress. Alternate ways in the admin bar change in light of the jobs and permissions of users in WordPress.

However, while viewing public pages on your website, the admin bar can be a little distracting. It might likewise influence your website plan and user experience. Fortunately, there are multiple approaches to effectively disable the WordPress Admin bar for all users except admins.

Method 1: Disable the WordPress Admin Bar for Every User

WordPress allows any user to disable the admin bar by basically editing their user profile. As a site admin, you can edit other user profiles and disable the Admin bar for them. If you have any desire to the disable Admin bar for a specific user in WordPress, you want to edit his user profile.

  • Simply go to the Users » All Users page and then click on the “edit” link to disable the admin bar for any user you need.
  • This will take you to the user profile editor page. From here, uncheck the crate close to the “Show toolbar while viewing site” choice,
  • To save the changes, look down and click the “Update User” button.
  • This will disable the Admin bar for that specific user while visiting the website.

If you have a handful of users, you can manually disable the admin bar for all of them. However, if you run an enrollment site with countless users, this method won’t work.

Fortunately, there are other methods that can rapidly disable the Admin bar for all users other than admins.

Method 2: Use the Hide Admin Bar in View of User Roles Plugin

This method allows you to rapidly disable the WordPress admin bar for all users. In the first place, you really want to install and actuate the Hide Admin Bar in the view of User Roles plugin.

Once enabled , go to Settings » Hide Admin Bar Settings page. From here, actually, look at the crates close to the user jobs you need to disable the Admin bar.

Remember to click the “Save Changes” button to save your settings.

Method 3: Use Code to Disable Admin Bar

Disable WordPress Admin Bar

This method expects you to add code to your WordPress layout files. Basically, add the following code to your theme’s functions.php file or a site-specific plugin.

This code checks if the ongoing user is an admin and if they are not, they won’t see the admin bar. If the two conditions are met, your work will be done. Remember to save your changes and test your website to ensure everything is working fine.

Method 4: Disable Admin Bar for All Users Including Admins

What if you have any desire to disable the admin bar for all users including yourself and some other admin on your site? You can do this by modifying the code we showed before.

Just add the following code to your theme’s functions.php file or a site-specific plugin.

Also see: How to Create and Sell Online Courses With WordPress

This code will disable the admin bar for all users while viewing public pages of your website. All users can in any case see the toolbar inside the WordPress admin dashboard.

You may also like...

Leave a Reply

Your email address will not be published.