Setup & site building · Guide
How to Remove the WordPress Admin Bar (Step by Step)

Short answer
To remove the WordPress admin bar for yourself, go to Users, then Profile, untick Show Toolbar when viewing site and save. To hide it for other users, add a show_admin_bar filter in a code snippets plugin, ideally with a capability check so administrators keep it.
Key takeaways
- The admin bar (the Toolbar) only shows to logged-in users, never to visitors.
- Untick Show Toolbar when viewing site in your profile to hide it for yourself.
- The show_admin_bar filter hides it for all users on the front end.
- Add a capability check to keep the bar for admins but hide it for customers.
- Put code in a snippets plugin or child theme, not the parent theme.
- CSS hiding is a last resort because the bar still loads.
What is the WordPress admin bar?
The admin bar, which WordPress officially calls the Toolbar, is the dark strip at the top of the screen that logged-in users see on both the dashboard and the front end of the site.
It gives quick links to the dashboard, new posts, comments, your profile and the Edit Page link. Plugins such as SEO and caching tools often add their own menus to it.
Visitors who are not logged in never see it. So if you are worried that the public sees the bar, they do not. Only people with an account who are signed in will see it.
The official WordPress Toolbar documentation explains each part of the bar. This guide covers the ways to hide it, for yourself or for other users.
Why would you want to remove the admin bar?
Most people remove the admin bar to preview the site exactly as visitors see it, or to stop subscribers and customers from seeing a WordPress menu that makes no sense to them.
Common reasons include:
- Cleaner previews. The bar pushes the page down by 32 pixels, which can make headers and sticky menus look wrong while you design.
- Membership and shop sites. Customers who log in to a WooCommerce account or a course site see a bar full of links they cannot use.
- Design clashes. Some themes with fixed headers overlap the bar, especially on mobile.
- Client sites. Clients sometimes click links in the bar and end up in places you would rather they did not.
If the bar only bothers you, a profile setting is enough. If you want to hide it for a whole group of users, use a code snippet or a plugin.
How do you hide the admin bar for your own account?
Go to Users > Profile, untick Show Toolbar when viewing site, and click Update Profile to hide the bar on the front end for your account only.
This is the safest method because it needs no code and affects nobody else. Here are the steps:
- Log in to your WordPress dashboard.
- Go to Users > Profile (or click your name in the top-right corner and choose Edit Profile).
- Find the Toolbar option near the top of the page.
- Untick Show Toolbar when viewing site.
- Scroll down and click Update Profile.
Now visit any page on your site. The bar should be gone. If it still appears, clear your browser cache and any page cache, then reload.
An admin can do the same for another user. Go to Users > All Users, click Edit under that person's name, untick the same box and save. This works well when you only have a handful of accounts.
Note that this setting only affects the front end. Inside wp-admin the bar always shows, because the dashboard relies on it.
How do you remove the admin bar for all users with code?
Add add_filter( 'show_admin_bar', '__return_false' ); to a code snippets plugin or your child theme's functions file, and WordPress will hide the front-end bar for every logged-in user.
WordPress provides a filter called show_admin_bar for exactly this purpose. The show_admin_bar hook reference documents how it works. Returning false tells WordPress not to load the bar on the front end.
// Hide the admin bar on the front end for everyone
add_filter( 'show_admin_bar', '__return_false' );
There is also a function form, documented on the show_admin_bar() function page:
show_admin_bar( false );
Both do the same job. The filter version is the more flexible choice because you can add conditions to it, as shown in the next section.
Where to put the code matters. Do not paste it into your parent theme's functions file, because a theme update will wipe it out. Use one of these options instead:
- A code snippets plugin such as Code Snippets or WPCode.
- The functions file of a child theme.
- A small custom plugin of your own.
If a snippet does nothing after you save it, check that it is active and set to run everywhere. Our guide on WPCode snippets not working covers the usual reasons.
How do you hide the admin bar for everyone except administrators?
Wrap the filter in a capability check, such as current_user_can( 'manage_options' ), so administrators keep the bar while subscribers, customers and other roles do not see it.
This is the most common setup for membership sites, online courses and WooCommerce stores. Your team keeps quick access to the dashboard, while customers get a clean front end.
add_filter( 'show_admin_bar', function ( $show ) {
if ( ! current_user_can( 'manage_options' ) ) {
return false;
}
return $show;
} );
The manage_options capability belongs to administrators by default. If you want editors to keep the bar too, use a capability editors have, such as edit_others_posts.
The current_user_can() reference lists how capability checks work. If you are unsure which roles hold which permissions, read our explainer on WordPress user roles.
You can also target one role directly. This version hides the bar only for subscribers:
add_filter( 'show_admin_bar', function ( $show ) {
$user = wp_get_current_user();
if ( in_array( 'subscriber', (array) $user->roles, true ) ) {
return false;
}
return $show;
} );
Checking capabilities is usually better than checking role names. Capabilities keep working when you rename roles or add custom user roles later.
Can you remove the admin bar with a plugin?
Yes, several free plugins hide the admin bar by role with a few checkboxes, which suits site owners who do not want to touch PHP code.
Search the plugin directory for hide admin bar and you will find options that let you choose which roles see the bar. Most work by applying the same show_admin_bar filter shown above, just behind a settings screen.
When you pick one, check three things:
- It was updated recently and is tested with your WordPress version.
- It has a solid number of active installs and replies in its support forum.
- It does only what you need. A single-purpose plugin is lighter than a large admin toolkit.
Some membership, LMS and WooCommerce extensions also include a setting to hide the bar for customers. Check your existing plugins before you install another one.
Should you hide the admin bar with CSS?
Hiding the bar with CSS is a last resort, because the bar still loads in the background and WordPress still adds a 32-pixel top margin unless you override that too.
You might see snippets like this online:
#wpadminbar { display: none !important; }
html { margin-top: 0 !important; }
The CSS display property set to none hides an element visually, but the browser still downloads the HTML, scripts and styles behind it. The PHP filter stops WordPress from outputting the bar at all, which is cleaner and slightly faster.
CSS can make sense in one case: when you only want to hide the bar on a single page template or screen size and cannot use PHP. For everything else, use the profile setting or the filter.
If your CSS changes do not seem to apply, see why CSS changes are not showing for cache and specificity fixes.
Which method should you choose?
Use the profile checkbox for yourself, a capability-based snippet for whole groups of users, and a plugin only if you prefer settings to code.
| Method | Who it affects | Needs code | Best for |
|---|---|---|---|
| Profile setting | One user | No | Hiding it for yourself |
| Edit user screen | One user at a time | No | A few specific accounts |
show_admin_bar filter | All users | Yes | Sites that never need the front-end bar |
| Filter with capability check | Selected roles | Yes | Stores, memberships, courses |
| Plugin | Selected roles | No | Owners who avoid code |
| CSS | Visual only | Yes (CSS) | Rare edge cases |
What should you do if the admin bar still shows?
If the bar still appears, clear every cache layer, confirm the snippet is active, and check whether another plugin or the theme forces the bar back on.
Work through these checks in order:
- Clear caches. Purge your caching plugin, server cache and CDN, then test in a private browser window.
- Check you are on the front end. The bar always shows inside wp-admin. The methods here only hide it on the public side.
- Confirm the snippet runs. A snippet saved but not activated, or set to admin only, will not work.
- Look for conflicts. Another plugin may call the same filter with a higher priority. Try
add_filter( 'show_admin_bar', '__return_false', 999 );. - Check the theme. A few themes add their own toolbar setting. Look in the Customizer or theme options.
If you hit a blank screen after adding PHP code, remove the snippet by FTP or through your host's file manager. A missing semicolon or bracket is the usual cause.
That kind of mistake triggers a PHP parse error. The PHP manual explains the language syntax if you want to check what went wrong.
Does removing the admin bar affect speed or security?
Removing the admin bar has no real security effect, and the speed gain is small, though it does save logged-in users a few scripts and styles on each front-end page.
The bar is not shown to anonymous visitors, so hiding it does not change what attackers see. It also does not block anyone from the dashboard. Users can still type the wp-admin address directly.
If you want to keep subscribers out of the dashboard as well, that is a separate task. You would need a redirect that sends non-admins away from wp-admin, which many membership plugins offer.
For logged-in users, the bar loads its own CSS, JavaScript and sometimes extra menu items from plugins. Removing it trims a little weight from those page loads. If your dashboard itself feels slow, our guide on how to speed up WordPress admin covers the bigger causes.
Frequently asked questions
Can I remove the admin bar inside the WordPress dashboard?
Not with the standard methods. The profile setting and the show_admin_bar filter only affect the front end of your site. Inside wp-admin, the Toolbar always loads because the dashboard depends on it for menus and notices.
Do visitors see the WordPress admin bar?
No. The admin bar only appears for users who are logged in. Anonymous visitors never see it, so you do not need to hide it for public traffic. If you see it, you are viewing the site while signed in.
Will a theme update remove my admin bar code?
Yes, if you placed the code in the parent theme's functions file. Theme updates replace that file. Put the snippet in a code snippets plugin, a child theme or a small custom plugin so it survives updates.
How do I hide the admin bar for WooCommerce customers?
Use the show_admin_bar filter with a capability check, so only users who can manage options or manage the shop keep the bar. Some WooCommerce setups already hide it for customers, so check first before adding code.
Why is there a gap at the top after hiding the bar with CSS?
WordPress adds a top margin to the page to make room for the Toolbar. Hiding the bar with CSS does not remove that margin. Use the PHP filter instead, or also reset the html top margin in your CSS.
Sources
- Toolbar WordPress.org Documentation
- show_admin_bar hook WordPress Developer Resources
- show_admin_bar() function WordPress Developer Resources
- current_user_can() function WordPress Developer Resources
- display property MDN Web Docs
Is your product missing, or something out of date?
Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.
Thanks — we review requests within 3 business days.
Related guides
About the editors
Researched from the primary sources listed above and checked against our editorial rules before publishing.


