Plugins Plugin hub Backup SEO Caching Security Forms WooCommerce Images Best backup plugins
Hosting Hosting directory Shared hosting Managed WordPress Cloud hosting VPS hosting By reader location Hosting finder
Themes & builders Compare Rank Math vs Yoast
Tools All tools Hosting finder Plugin stack builder Cost calculator Salt generator Theme detector Who is hosting this? Speed test Headline analyzer robots.txt generator Redirect generator Uptime calculator Blog name generator
Blog Best backup plugins Deals
Guides All guides Speed up WordPress Choose hosting Back up WordPress
How we test

Setup & site building · Guide

How to Remove WordPress Header Bar (Step by Step)

How to Remove WordPress Header Bar (Step by Step)

Short answer

To remove the WordPress header bar for your own account, go to Users > Profile, untick Show Toolbar when viewing site and click Update Profile. To hide it for all users, add the show_admin_bar filter set to false in a child theme or snippets plugin. Visitors who are not logged in never see it.

Key takeaways

  • The header bar is usually the admin Toolbar, shown only to logged-in users.
  • Untick Show Toolbar when viewing site in Users > Profile for your own account.
  • The show_admin_bar filter hides it for all users or for non-admins.
  • WordPress has no core option to hide the toolbar inside the dashboard.
  • Theme headers are removed through page settings or block theme templates.

What is the WordPress header bar?

The WordPress header bar is usually the black admin toolbar that appears across the top of your site when you are logged in, with links to the dashboard, new posts and your profile.

Its official name is the Toolbar, though many people call it the admin bar. Only logged-in users see it. Visitors who are not logged in never see it, so it does not affect how your public site looks to them.

Some people use header bar to mean the theme header instead: the area with your logo and menu. This guide covers both, starting with the admin toolbar because that is what most people want to hide.

Pick the method that fits your goal:

GoalBest methodCode needed
Hide the toolbar for yourselfProfile settingNo
Hide it for all usersshow_admin_bar filterYes, one line
Hide it for everyone except adminsConditional filterYes, a few lines
Hide it from the dashboard tooPlugin or admin CSSUsually
Remove the theme header on one pageTheme or builder page settingNo
Remove the theme header site-wideSite Editor or CustomizerNo

How do you hide the admin toolbar for your own account?

Go to Users > Profile, untick Show Toolbar when viewing site, then click Update Profile at the bottom of the page.

This is the quickest method and needs no code. Here are the steps:

  1. Log in to your WordPress dashboard.
  2. Open Users > Profile from the left menu.
  3. Find Toolbar near the top of the Personal Options section.
  4. Untick Show Toolbar when viewing site.
  5. Scroll down and click Update Profile.

Now visit your site's front end. The black bar is gone for your account only. Other users still see it until they change their own setting.

The setting is stored per user, so it follows your account across devices and browsers. If you log in on a phone or a second computer, the bar stays hidden there too.

This is a good choice for site owners who find the bar distracting while checking designs. It does not stop the bar from appearing inside the dashboard, where it is always present.

The Your Profile screen documentation describes each option on this page.

Administrators can change this setting for another user too. Open Users > All Users, edit the user, untick the same box and save.

How do you hide the toolbar for all users with code?

Add the show_admin_bar filter returning false to a child theme or a code snippets plugin, and the front-end toolbar disappears for every logged-in user.

The code is one line:

add_filter( 'show_admin_bar', '__return_false' );

WordPress documents this filter on the show_admin_bar hook page. It controls the toolbar on the front end only.

Where you put it matters. If you paste it into a parent theme's functions file, a theme update will erase it. Use a child theme or a plugin such as Code Snippets instead.

After adding the code, reload the front end. If the bar still shows, clear your page cache, because cached pages can keep old markup.

How do you hide the toolbar for everyone except administrators?

Wrap the show_admin_bar() function in a capability check, so only users who can manage the site keep the toolbar.

This is popular on membership sites, online courses and stores, where customers log in but do not need dashboard shortcuts.

add_action( 'after_setup_theme', function () {
    if ( ! current_user_can( 'manage_options' ) ) {
        show_admin_bar( false );
    }
} );

The manage_options capability normally belongs only to administrators. To keep the toolbar for editors as well, check a capability editors have, such as edit_others_posts.

Our explainer on WordPress user roles lists which roles hold which capabilities. Pick the capability that matches the group you want to keep it for.

You can also check the role directly, but capability checks are more reliable. Custom roles created by plugins often have their own names, while capabilities stay consistent.

Test the code by logging in as a user from each role. A spare test account for each role makes this quick, and you can delete the accounts afterwards.

WooCommerce already hides the toolbar for customers on many setups. If you run a store, check before adding code, because you may not need it.

Can you remove the toolbar from the dashboard?

WordPress always shows the toolbar inside the admin area, and there is no core setting to turn it off there, so you need a plugin or admin CSS.

The profile setting and the filter only affect the front end. Inside wp-admin the bar holds important controls, like the user menu and logout link.

If you still want it gone, an admin customization plugin can hide it per role. Search the plugin directory for admin toolbar or admin bar options, and check that the plugin is maintained.

Removing it from the dashboard can confuse other users who look for the logout link. Think about who uses the admin before you hide it.

A lighter option is to remove single items from the toolbar instead of the whole bar. Developers can do this with the remove_node method on the admin bar object, for example to drop the comments or new content shortcuts.

That keeps the logout link and user menu while cutting clutter for clients who only edit a few pages.

Should you hide the toolbar with CSS?

CSS hides the toolbar visually, but the markup and scripts still load and a 32 pixel gap may remain, so use the filter instead where you can.

If you must use CSS, for example inside a page builder's custom CSS box, this hides the bar and closes the gap:

#wpadminbar { display: none !important; }
html { margin-top: 0 !important; }

The CSS display property reference explains how display none removes an element from the layout.

Treat this as a quick fix. The filter is cleaner because WordPress never prints the bar, so no extra code reaches the browser.

Why does a gap stay at the top after removing the toolbar?

A blank strip usually means a theme or cache still adds the 32 pixel margin that WordPress uses to make room for the toolbar.

WordPress adds a top margin to the page when the toolbar shows. When the toolbar is removed properly with the filter, that margin goes too.

If a gap remains:

  • Clear every cache. See our guide on how to clear cache in WordPress.
  • Check your theme for a fixed header with its own top offset.
  • Look for custom CSS that sets margin-top on the html or body element.

Test in a private window while logged in as a non-admin user to see exactly what they see.

How do you remove the theme header instead?

To remove the theme header, use your theme's page setting to disable it on one page, or edit the header template part in a block theme to remove it everywhere.

Most popular themes, such as Astra, Kadence, Blocksy and GeneratePress, have a per-page option to turn off the header. Look in the page editor sidebar for a theme settings panel.

In a block theme, open Appearance > Editor, choose Templates, and edit the template. Select the header template part and remove it, or create a separate template without a header for landing pages.

Our guide on editing the header in a block theme explains templates and template parts.

For classic themes, see our guide on changing the header in WordPress.

Removing the site header entirely hurts navigation. Keep at least a logo link and menu on pages where visitors need to move around.

What should you check after removing the header bar?

Check the site as each user role, in a private window, on mobile and after clearing caches, so you know the change looks right for everyone.

A short checklist helps:

  • Log in as an administrator and confirm you still have what you need.
  • Log in as a subscriber or customer and confirm the bar is gone.
  • Check the layout on a phone for any leftover gap.
  • Confirm users can still log out from the account page or menu.

If customers lose the toolbar, they also lose its logout link. Add a logout link to your account page or menu, so people are not stuck logged in.

The Learn WordPress user management lesson covers profiles and roles if you manage many users. To move users between roles after this change, see our guide on changing user roles in WordPress.

Frequently asked questions

Do visitors see the WordPress admin bar?

No. The toolbar only appears for logged-in users. Visitors who are not logged in never see it, so hiding it changes nothing for the public. It only matters for administrators, editors, customers and members who log in.

Why is there a white gap at the top after removing the toolbar?

A cache or theme style is still adding the space WordPress reserves for the toolbar. Clear all caches first. If the gap remains, check your theme and custom CSS for a top margin on the html or body element.

Can I hide the toolbar only for customers?

Yes. Use show_admin_bar set to false inside a check for a capability that customers lack, such as manage_options. WooCommerce already hides it for customers on many setups, so check your store before adding code.

Is it safe to add the admin bar code to functions.php?

It works, but a parent theme update will erase it, and a typo can break the site. Put it in a child theme or a code snippets plugin, and take a backup before editing any PHP.

How do I remove the header on just one page?

Most popular themes have a per-page setting in the editor sidebar to disable the header. In a block theme, create a custom template without the header template part and assign it to that page.

Sources

  1. show_admin_bar hook WordPress Developer Resources
  2. show_admin_bar() function WordPress Developer Resources
  3. Users Your Profile Screen WordPress.org
  4. User management lesson Learn WordPress
  5. display 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.

About the editors

Written and checked byWPLegible Editorial Team Independent WordPress reviews and guides

Researched from the primary sources listed above and checked against our editorial rules before publishing.