The WordPress admin bar is a handy tool for site administrators, offering quick access to backend features. It is a toolbar that appears at the top of the screen for all logged-in users. It provides quick access to various features and settings of WordPress, such as the dashboard, themes, widgets, menus, customization, new page, edit post, etc. But for non-admin users, it can clutter the frontend and lead to confusion or accidental clicks. However, you may want to disable the WordPress admin bar for some or all of your users for various reasons. For instance, you may want to:
- Improve the front-end design and user experience of your website
- Prevent non-admin users from accessing the backend of your website
- Reduce the load on your server and improve performance
- Simplify the user interface and avoid confusion
In this blog post, we will show you how to disable the WordPress admin bar for all users except administrators using different methods. You can choose the method that suits your needs and preferences.
Why Disable the Admin Bar for Non-Admins?
- Cleaner frontend experience for subscribers, contributors, and customers
- Reduces accidental access to backend features
- Improves performance by removing unnecessary UI elements
- Streamlines user roles for better UX and security
Methods to Disable WordPress Admin Bar
Here, we’ll explore three effective methods to disable the admin bar for all or some specific users except administrators.
Method 1: Disable WordPress Admin Bar for Specific Users Manually

The easiest way to disable the WordPress admin bar for specific users is to edit their user profile settings. This method is suitable if you have a small number of users and you want to disable the admin bar for some of them individually.
To do this, follow these steps:
- Go to Users > All Users in your WordPress dashboard.
- Hover over the user name of the user you want to disable the admin bar for and click on Edit.
- Scroll down to the Toolbar section and uncheck the box next to Show Toolbar when viewing the site.
- Click on Update User to save your changes.
Repeat these steps for any other user you want to disable the admin bar for.
Method 2: Disable WordPress Admin Bar Using PHP Code
If you want to disable the WordPress administration bar for all users except administrators, you can use a code snippet to do so. This method is recommended if you are comfortable with editing your theme files or using a site-specific plugin.
To use this method, follow these steps:
- Go to Appearance > Theme Editor in your WordPress dashboard.
- Select the functions.php file of your active theme from the right sidebar.
- Scroll down to the end of the file and paste the following code snippet:
// Disable WordPress Admin Bar for all users except administrators
add_action('after_setup_theme', 'remove_admin_bar');
function remove_admin_bar() {
if (!current_user_can('administrator') && !is_admin()) {
show_admin_bar(false);
}
}
- Click on Update File to save your changes.
This code snippet will check if the current user is an administrator or not. If not, it will hide the admin bar from the front-end of your website.
Tip: Always back up your site before editing theme files.
Method 3: Use a Plugin (No Coding Required)
Another way to disable the WordPress admin bar for all users except administrators is to use a plugin. This method is suitable if you prefer not to edit any code or files on your website.
There are several plugins that can help you with this task, but we will use Hide Admin Bar on User Roles as an example. This plugin allows you to hide the admin bar for selected user roles with a few clicks.
To use this plugin, follow these steps:
- Install and activate the Hide Admin Bar on User Roles plugin from the WordPress plugin repository.
- Go to Settings > Hide Admin Bar Settings in your WordPress dashboard.
- Select the Hide Admin Bar for Selected User Roles option.
- Check all the user roles except Administrator from the list.
- Click on Save Changes to apply your settings.
This plugin will hide the admin bar for all users except administrators based on their user roles.
Conclusion
In this blog post, we have shown you how to disable the WordPress administration bar for all users except administrators using different methods. You can choose the method that works best for you and your website.
Disabling WordPress admin bar can help you improve the design and user experience of your website, prevent unauthorized access to your backend, reduce server load and improve performance, and simplify the user interface.
We hope you found this blog post helpful and informative. If you have any questions or feedback, please feel free to leave a comment below.
Read More:
How to Add Google AdSense to Your WordPress Site