Roconpaas

Blog

Hide WordPress Admin Bar – Rocon’s Simple Guide

April 25, 2025 by Benjamin

WordPress Keeps Logging Me Out

Introduction

Hide WordPress admin bar: When you log into your site, the WordPress admin bar is a useful toolbar showing at the top of the screen. It provides fast access to themes, plugins, pages, dashboard tools, and more. There are, therefore, times when concealing the admin bar is best for both utility and appearance.

This all-inclusive tutorial will reveal several techniques to conceal the WordPress admin bar, who should (or shouldn’t) see it, and best practices for wise management whether your project is a client-facing website, a membership portal, or simply a desire for a cleaner user experience.

Build Your Business Website for FREE with Rocon!

Send Us Your Website Requirement

The WordPress Admin Bar is what?

For logged-in users, the WordPress admin bar—also known as the toolbar—appears at the top of the site. It gives access to: Dashboard

  1. Change profile
  2. Remarks Changes
  3. New post/page/product Plugin/theme-specific shortcuts 
  4. All logged-in users by default view this bar when front-end browsing the site. Although beneficial for editors and administrators, it can be irrelevant or irritating for other user roles as subscribers, consumers, or contributors.

Why Conceal the Admin Bar of WordPress?

There are several factors that could lead you to turn off the admin bar on your WordPress site:

  • Sleeker Front-End Experience: The admin bar could conflict with the design or brand experience for client or public-facing websites.
  • Client Access Control: Don’t confuse clients or non-technical users without backend access.
  • Membership Websites: Should you be creating a community or e-learning site, you might want to limit subscription admin visuals.
  • Custom Themes or Layouts: The bar could conflict with custom layout components, sticky menus, or headers.
  • Hiding the admin bar helps to lower the surface area for possible access or functional abuse.

Method 1: Disable Admin Bar via User Profile Settings

If you only want to disable the admin bar for your own account, WordPress makes this easy.

Steps:

  1. Go to Users > Profile
  2. Uncheck the box: “Show Toolbar when viewing site”
  3. Click Update Profile

This will remove the admin bar only for your specific user account. Every user must do this individually if they want the same result.

Method 2: Hide Admin Bar for All Users Except Admins

To programmatically hide the admin bar for everyone except administrators, you can add a small function to your functions.php file.

add_action(‘after_setup_theme’, ‘hide_admin_bar_for_non_admins’);

function hide_admin_bar_for_non_admins() {

    if (!current_user_can(‘administrator’)) {

        show_admin_bar(false);

    }

}

This ensures only administrators retain access to the toolbar, while everyone else sees a clean front end.

Note: Always backup your functions.php file before editing it.

Method 3: Hide Admin Bar for Specific User Roles

Want to hide the admin bar for certain roles like subscribers or customers? Extend the logic with conditional checks:

add_action(‘after_setup_theme’, ‘hide_admin_bar_for_specific_roles’);

function hide_admin_bar_for_specific_roles() {

    $user = wp_get_current_user();

    $roles_to_hide = array(‘subscriber’, ‘customer’, ‘contributor’);

 

    if (array_intersect($roles_to_hide, $user->roles)) {

        show_admin_bar(false);

    }

}

This code disables the toolbar only for the listed roles while preserving it for others.

Method 4: Hide Admin Bar on the Front-End Only

You might want to show the toolbar in the dashboard but not on the public-facing site.

if (!is_admin()) {

    show_admin_bar(false);

}

Add this to functions.php to disable the admin bar when viewing the front end of your site.

Method 5: Hide Admin Bar with a Plugin

Not comfortable editing code? Plugins can simplify the process.

Popular Plugins:

  • Hide Admin Bar – A simple plugin with role-based visibility options.
  • Adminimize – Offers detailed control over the admin area and toolbar.
  • WP User Manager – Useful if you’re managing user roles and permissions extensively.

Pros of Using a Plugin:

  • No coding required
  • Granular control
  • Easier updates and reversibility

Cons:

  • Adds another plugin to maintain
  • May introduce conflicts if poorly coded

Method 6: Use CSS to Hide the Admin Bar

For designers who prefer a front-end solution, CSS can be used to visually hide the toolbar.

#wpadminbar {

    display: none !important;

}

body.admin-bar {

    margin-top: 0 !important;

}

Add this to your theme’s stylesheet or through the Customizer > Additional CSS.

Note: This hides the toolbar visually but doesn’t stop it from loading or functioning in the backend.

Method 7: Hide Admin Bar with a Custom Plugin

If you prefer not to modify functions.php, you can create a small custom plugin.

Steps:

  1. Go to wp-content/plugins/ and create a new folder, e.g., hide-admin-bar
  2. Create a PHP file hide-admin-bar.php inside it
  3. Paste this code:

<?php

/*

Plugin Name: Hide Admin Bar

Description: Disables admin bar for all users except admins

Version: 1.0

*/

add_action(‘after_setup_theme’, ‘custom_hide_admin_bar’);

function custom_hide_admin_bar() {

    if (!current_user_can(‘administrator’)) {

        show_admin_bar(false);

    }

}

  • Save and activate the plugin in your WordPress dashboard.

Advanced Control with Capability Checks

You can also control admin bar visibility based on custom capabilities, not just roles. This is useful when your site uses advanced membership or permission plugins.

add_action(‘after_setup_theme’, ‘custom_capability_hide_toolbar’);

function custom_capability_hide_toolbar() {

    if (!current_user_can(‘edit_posts’)) {

        show_admin_bar(false);

    }

}

This approach works well when assigning capabilities with plugins like Members or User Role Editor.

Testing Your Changes

After implementing any method:

  • Log out and test the front-end as a non-admin user
  • Try different roles via incognito or user switching
  • Check if page layout or performance is affected

If using caching plugins, clear your cache after making changes to ensure updates take effect.

When Not to Hide the Admin Bar

Although there are valid reasons to remove the toolbar, consider situations where it might be useful:

  • For administrators, it speeds up workflow
  • Editors may need it for quick access to content tools
  • It provides helpful quick links for site management

In short, avoid disabling it for users who benefit from its functionality.

Conclusion

Though not necessarily required for every user or use scenario, the WordPress admin bar is a useful feature. Hiding the admin bar can help to streamline the front-end experience, minimize distractions, and keep non-admin users focused depending on your objectives, user base, and site design.

This article provides you a thorough picture of how to properly control the WordPress admin bar whether you like utilizing code, plugins, or CSS. Use it to improve usability, protect your site’s layout, and maintain better control over what each user sees.

Knowing your website’s requirements and the functions of its users will help you to confidently choose when and how to display—or hide—the WordPress admin bar.

Get your FREE website development with Rocon!

Share Your Website Details

Start the conversation.

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    Recommended articles

    WordPress

    Hide WordPress Admin Bar – Rocon’s Simple Guide

    Benjamin

    Icon

    6 Min Read

    WordPress

    350+ Unused Cleaning Business Names 2025 – Ideas by Rocon

    Adam

    Icon

    8 Min Read

    WordPress

    How to Build a WordPress eCommerce Site​ Fast – Rocon

    Maria

    Icon

    9 Min Read