Easy methods to disable the WordPress admin bar for all customers besides directors

Would you just like to disable the admin bar in WordPress?

By default, you can simply disable the WordPress admin bar for each user from the dashboard. However, this method may take some time if there are many registered users on your website.

In this article, we’re going to show you how to disable the WordPress admin bar for all users except administrators.

What is the WordPress Admin Bar?

By default, WordPress shows an admin bar at the top for all logged in users. This toolbar is displayed in the WordPress administration area as well as on all other pages when you are logged in.

WordPress Admin Bar

The WordPress admin toolbar contains useful shortcuts to various WordPress sections. The shortcuts available in the admin bar change depending on the user role and permissions in WordPress.

However, when viewing the public pages in the front end of your website, the admin bar can be a bit distracting. This can also affect the design and user experience of your website.

Fortunately, there are several ways to simply disable the WordPress admin bar for all users except administrators.

Method 1. Disabling the WordPress admin bar for each user

With WordPress, any user can disable the admin bar by simply editing their user profile. As a website owner, you can also edit the profiles of other users and deactivate the admin bar for them.

If you want to disable the admin bar for a specific user in WordPress, you need to edit their user profile.

Just go to the User »All users Then click the “Edit” link for each user that you want to disable the admin bar for.

Edit user settings

This will take you to the User Profile Editor page. From here, uncheck the box next to the “Show toolbar when viewing site” option.

Deactivate the admin bar

Scroll down and click the “Update User” button to save your changes.

This will disable the admin bar for that particular user when they visit the website.

Page without admin bar

If you have a handful of users, you can manually disable the admin bar for all of them. However, if you have a membership site with many users, this method will not work.

Fortunately, there are other ways to quickly disable the admin bar for all users except administrators.

Method 2. Disable the admin bar for all users except administrators with a plugin

This method is a quick way to disable WordPress admin for all users.

First you have to install and activate the plugin “Hide admin bar based on user roles”. For more information, see our step-by-step guide on installing a WordPress plugin.

After activation, go to Settings »Hide settings in the admin bar Page. From here, check the boxes next to the user roles where you want to disable the administrator bar.

Hide the admin settings with a plugin

Don’t forget to click the “Save Changes” button to save your settings.

Method 3. Disable the admin bar for all users except administrators who use code

This method involves adding code to your WordPress theme files. If you haven’t already, check out our guide on how to copy and paste snippets of code in WordPress.

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

add_action (‘after_setup_theme’, ‘remove_admin_bar’); Function remove_admin_bar () {if (! Current_user_can (‘Administrator’) &&! Is_admin ()) {show_admin_bar (false); }}

This code checks that the current user is not an administrator and is not showing the administrator dashboard. If both conditions match, the WordPress admin bar will be disabled.

Don’t forget to save your changes and check your website to make sure everything is working fine.

Method 4. Disable the admin bar for all users, including administrators

What if you want to disable the admin bar for all users, including yourself and other administrators on your website?

You can do this by changing the code shown earlier.

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

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

This code disables the admin bar for all users when viewing your website’s public pages. All users can still see the toolbar in the WordPress admin dashboard.

We hope this article has helped you to disable the WordPress admin bar for all users except administrators. You might also want to check out our ultimate WordPress security guide and our comparison of the best WordPress page builder for creating custom page layouts without code.

If you enjoyed this article, please subscribe to our YouTube channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Comments are closed.