Hide or Remove WordPress Admin Bar Easily

The WordPress admin bar appears at the top of your site whenever a logged-in user visits the front end. For many site owners it disrupts the layout or gives client accounts access to controls they don’t need. This guide covers four methods — Settings toggle, PHP snippet, per-role code, and a plugin — so you can pick the right fix for your situation.

TL;DR: Three quick options: (1) uncheck Show Toolbar when viewing site in Users → Your Profile for your own account only; (2) add one line to functions.php to remove the bar for every logged-in user; (3) install the Auto Hide Admin Bar plugin for a no-code solution. Use Method 3 if you want to hide it for subscribers and contributors while keeping it for editors and admins.

Why the WordPress Admin Bar Appears (and When to Remove It)

WordPress shows the admin bar on the front end for every logged-in user by default. It is driven by the show_admin_bar() function, which returns true for all roles out of the box. Common reasons to remove it include:

  • Front-end layout conflicts — the bar adds a fixed toolbar at the top that can clash with custom navigation or theme headers.
  • Client-account hygiene — subscriber and contributor accounts that don’t need admin access shouldn’t see admin links on the public site.
  • Distraction-free previews — designers and theme developers often want a clean viewport when reviewing live pages.

Which method is right for you?

Your situation Best method
Hide it for your own account only Method 1: Settings toggle
Hide it for subscribers and contributors; keep it for editors and admins Method 3: Per-role PHP code
Remove it for every logged-in user permanently Method 2: functions.php snippet
No coding preferred Method 4: Plugin

Method 1: Hide the Admin Bar via WordPress Settings (Per-User Toggle)

The quickest option — no code, no plugin, no site-wide change. Each user can toggle the admin bar for their own account from their profile page.

Log in to your WordPress dashboard.

WordPress Dashboard

Go to Users → Your Profile, scroll down to the Toolbar section, uncheck Show Toolbar when viewing site, and click Update Profile.

Uncheck Show Toolbar when viewing site Option

After saving, the bar disappears from the front end for that account only. It stays visible in the WordPress admin area — the backend toolbar carries status messages and update notices that are still useful. This setting is stored as the show_admin_bar_front user meta key in wp_usermeta and works in WordPress 6.7 and all earlier versions.

Method 2: Remove the Admin Bar for All Users with PHP Code

To remove the admin bar globally — for every logged-in user regardless of role — add a single filter to your theme’s functions.php. You’ll find the file at wp-content/themes/your-theme/functions.php. Right-click it in a file manager or open it via Appearance → Theme File Editor.

Edit Theme functions.php File for adding Code

Add this line to your functions.php file to remove the admin bar for all users:

add_filter( 'show_admin_bar', '__return_false' );
Add the code to your functions.php file to disable the top admin bar.
Note: I recommended to do code changes on a clone of your production site first before implementing it on your live site finally to prevent any possible errors. That is what WP Staging is for.

This hooks into WordPress’s show_admin_bar filter. Returning false unconditionally disables the toolbar for all roles on the front end. This removes the bar on the public site but does not affect the admin bar inside wp-admin dashboard pages.

Method 3: Hide the Admin Bar for Specific User Roles

The most common follow-up question after using Method 2: "I ran the snippet and now even my admin account can’t see the bar." The fix is targeting the snippet by role rather than applying it globally.

In WP STAGING’s support inbox, the most common request on this topic is hiding the bar for client accounts that don’t need admin access — and Method 3 is precisely how to do that: clients see the site as a visitor while the site owner’s admin account still has the toolbar.

Add this to functions.php instead:

add_action( 'after_setup_theme', function() {
    $user = wp_get_current_user();
    if ( in_array( 'subscriber', (array) $user->roles, true )
        || in_array( 'contributor', (array) $user->roles, true ) ) {
        show_admin_bar( false );
    }
} );

This calls show_admin_bar( false ) only when the current user is a subscriber or contributor. Editors, authors, and administrators continue to see the bar normally.

To hide the bar for all roles except administrators, use the manage_options capability check instead:

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

manage_options is the capability that separates administrators from every other role in a standard WordPress installation.

Method 4: Use a Plugin to Remove the Admin Bar

If you prefer a no-code approach, the Auto Hide Admin Bar plugin hides the bar automatically and slides it back into view when the user moves the cursor to the top of the screen.

Log in to your WordPress dashboard and navigate to Plugins → Add New Plugin.

Click on Add Plugin To Install Auto Hide Admin Bar Plugin

Search for Auto Hide Admin Bar, click Install Now, then Activate the plugin.

Install and Activate Auto Hide Admin Bar Plugin

Open the plugin’s settings page to configure which roles see the bar and adjust the slide-in behaviour.

Disable Top Bar Using Auto Hide Admin Bar Plugin

The plugin is a good fit when you want to keep the bar accessible for admins on demand without touching any code.

Troubleshooting: Admin Bar Still Showing After Fix

If the admin bar persists after applying one of the methods above, work through these checks:

Caching. A caching plugin can serve a cached page that still includes the admin-bar markup. Clear all caches after making your change, then test while logged in with caching bypassed. We’ve seen this issue occur when a caching plugin serves the admin-bar CSS to logged-out users — verifying the fix with caching off confirms whether that’s the cause.

Theme or plugin conflict. If you added the snippet to functions.php and the bar still appears, another plugin may be calling show_admin_bar( true ) later in the load order, overriding your filter. Temporarily deactivate other plugins one at a time to identify the conflict.

Snippet in the wrong file. The add_filter( 'show_admin_bar', '__return_false' ) call must run before the wp_head action fires. If you placed it inside a template file rather than functions.php, it may run too late.

Per-user profile override. WordPress applies the per-user profile setting after the show_admin_bar filter. If a user has Show Toolbar when viewing site checked in their profile, the bar will appear for that user even when the global filter returns false. Uncheck the option in their profile to override it.

Conclusion

The WordPress admin bar is useful during development and for administrators managing the site, but it is often unwanted for client accounts and subscriber-level users. This guide covered four methods: the per-user Settings toggle, a site-wide functions.php filter, a role-targeted snippet, and a plugin. Pick the method that matches your use case.

Before making code changes on your live site, test them on a staging copy first. WP STAGING lets you clone your production site so you can verify any change safely before it reaches real users.

Related Article

Rene Hermenau

Author: Rene Hermenau

About the author: René Hermenau is the founder of WP STAGING. He works on WordPress backups, staging, migrations, database handling, and safe deployment workflows.