Learn how to hide or remove admin bar in WordPress using simple methods, plugins, or code. Step-by-step guide for beginners and developers.
How to Hide or Remove Admin Bar in WordPress
If you’ve been searching for how to hide or remove admin bar in WordPress, you’re not alone. The WordPress admin bar, also known as the toolbar, appears at the top of every page when you’re logged in. While it provides quick access to features like creating new posts, editing content, or checking updates, not everyone finds it useful. For some site owners and developers, it can actually get in the way of the front-end design or disrupt the user experience.
In this article, we’ll cover multiple methods to disable, hide, or completely remove the WordPress admin bar. Whether you’re a beginner looking for a quick fix or a developer wanting to customize user experiences, you’ll find clear and actionable steps here.
Why Hide WP Admin Bar?
Before diving into how to hide or remove admin bar in WordPress, it’s important to understand why someone might want to do so:
-
Distraction-Free Front-End View: When designing or testing themes, the admin bar can cover important parts of your layout.
-
User Roles and Permissions: You may not want subscribers, contributors, or clients to see the admin bar when they log in.
-
Cleaner Design: If your website has a front-end membership or community system, removing the admin bar creates a more professional look.
-
Speed & Performance: While minimal, the admin bar loads scripts and styles that may not be necessary for all users.
How to Hide or Remove Admin Bar in WordPress
Now let’s explore the different methods you can use. We’ll start with the easiest options and then move toward advanced solutions.
Method 1: Disable Admin Bar from User Profile Settings
WordPress includes a built-in option to hide the admin bar for individual users.
- Go to your WordPress Dashboard.
- Navigate to Users → Profile.
- Under “Toolbar,” uncheck the option Show Toolbar when viewing site.
- Save changes.
This is a simple way to disable the toolbar for yourself but doesn’t affect other users.
Method 2: Hide the Admin Bar for All Users with Code
If you want to completely hide the toolbar for every user, adding a small code snippet can do the trick.
Open your theme’s functions.php file (or better, use a child theme) and add:
add_filter('show_admin_bar', '__return_false'); This single line disables the admin bar for all users.
Method 3: Hide Admin Bar Based on User Role
Sometimes you may want administrators and editors to keep the admin bar but remove it for subscribers or contributors. Here’s how:
function custom_hide_admin_bar() {
if (!current_user_can('administrator') && !is_admin()) {
show_admin_bar(false);
}
}
add_action('after_setup_theme', 'custom_hide_admin_bar'); This snippet ensures only administrators see the toolbar. Other logged-in users won’t have it displayed on the front end.
Method 4: Remove Admin Bar with CSS
Another lightweight approach is to use CSS. You can add the following code to your theme’s style.css or via Appearance → Customize → Additional CSS:
#wpadminbar {
display: none !important;
} While this hides the bar visually, it doesn’t stop WordPress from loading the related scripts. Use this method only if you prefer quick styling fixes.
Method 5: Use a WordPress Plugin
If you’re not comfortable editing code, plugins offer a beginner-friendly solution. Some popular plugins that allow you to disable or customize the admin bar include:
- Hide Admin Bar – Simple and straightforward.
- WPFront Toolbar Editor – Customize or disable the toolbar entirely.
- Adminimize – Provides deep customization of the admin interface.
To use:
- Install and activate your chosen plugin.
- Go to the plugin’s settings.
- Configure who should or shouldn’t see the admin bar.
Best Practices When Removing the Admin Bar
- Don’t disable it for administrators unless you’re sure you won’t need quick access to dashboard links.
- Use role-based restrictions if your site has multiple user types (e.g., students, members, or clients).
- Backup your site before editing
functions.php. A small error can break your site. - Prefer plugins or site-specific snippets rather than modifying the core theme directly.
Common Questions About the WordPress Admin Bar
Q1. Can I remove only specific items from the admin bar?
Yes. Using plugins like WPFront Toolbar Editor, you can customize which items appear instead of removing the whole bar.
Q2. Will removing the admin bar affect my site speed?
The impact is minimal, but for sites with high performance needs, disabling unnecessary scripts can provide slight improvements.
Q3. Is it possible to hide the admin bar only on certain pages?
Yes. You can use conditional tags in WordPress. For example:
if (is_page('contact')) {
add_filter('show_admin_bar', '__return_false');
} When Should You Keep the Admin Bar?
Although we’ve discussed how to hide or remove admin bar in WordPress, it’s worth noting that the toolbar can be useful:
- Quick Links: Direct access to edit posts, create new pages, or moderate comments.
- Notifications: Immediate updates on plugins, themes, and WordPress versions.
- Developer Shortcuts: For testing and debugging while building themes or plugins.
If you find these features helpful, you may want to customize the bar instead of removing it.
Conclusion
Learning how to hide or remove admin bar in WordPress is a simple but powerful way to improve user experience and streamline your website’s front end. Whether you use the built-in settings, a plugin, or custom code, the choice depends on your site’s needs and your comfort level with editing files.
For developers, code snippets provide the most control, while beginners may prefer the ease of plugins. The key is to balance convenience with functionality—removing the admin bar for non-admin users can create a cleaner and more professional site appearance.
Helpful External Resources
