How to Hide the WordPress Admin Bar Using a Plugin, PHP Code, and User Settings

How to Hide the WordPress Admin Bar

If you’re using WordPress, you’ve probably noticed the admin bar that appears at the top of your site when you’re logged in. While it’s useful for quick navigation, some website owners prefer a cleaner front-end experience and want to hide it—either for themselves, their clients, or certain user roles.

In this guide, I’ll show you three easy ways to hide the WordPress admin bar:

  • Using a plugin
  • Adding a simple PHP code snippet
  • Adjusting the user settings

Let’s get started.

Why Hide the WordPress Admin Bar?

The admin bar provides shortcuts to important areas like the dashboard, new post creation, and profile editing. However, you might want to hide it because:

  • You want a distraction-free experience on the front end.
  • You’re creating a membership or e-commerce site where the admin bar isn’t useful for regular users.
  • You’re delivering a client project and want the front end to look professional.

Method 1: Hide the Admin Bar Using a Plugin

If you’re not comfortable editing code, using a plugin is the easiest option.

Steps:

  • Log in to your WordPress dashboard.
  • Go to Plugins → Add New.
  • Search for “Hide Admin Bar.” Popular options include Hide Admin Bar or Adminimize.
  • Install and activate the plugin.
  • Configure the plugin settings to control who can see the admin bar (e.g., only admins, or no one at all).

This method is beginner-friendly and doesn’t require coding knowledge.


Method 2: Hide the Admin Bar with PHP Code

If you prefer a lightweight solution without using plugins, you can add a small PHP snippet to your theme.

Steps:

  • Log in to your hosting or WordPress admin panel.
  • Navigate to Appearance → Theme File Editor (or use an FTP client).
  • Open your theme’s functions.php file.
  • Add this code at the bottom of the file:
// Disable admin bar for all users except administrators
add_filter('show_admin_bar', function($show) {
    if (!current_user_can('administrator')) {
        return false;
    }
    return $show;
});

This snippet hides the admin bar for all users except administrators. If you want to hide it for everyone, you can simply use:

add_filter('show_admin_bar', '__return_false');

⚠️ Note: Always create a child theme or use a site-specific plugin before editing functions.php. This ensures your changes won’t be lost during theme updates.


Method 3: Hide the Admin Bar from User Settings

WordPress also allows you to disable the admin bar manually for each user.

Steps:

  • Log in to your WordPress dashboard.
  • Go to Users → All Users.
  • Click on the username you want to edit.
  • Scroll down to the section Toolbar.
  • Uncheck the box that says “Show Toolbar when viewing site.”
  • Save the changes.

This is a simple way to hide the admin bar for specific users without affecting everyone.


Which Method Should You Use?

  • For beginners: Use a plugin.
  • For developers or performance-focused users: Add the PHP snippet.
  • For site owners who only want to disable it for certain users: Use the user settings option.

Final Thoughts

The WordPress admin bar is helpful for many, but not always necessary. Whether you choose a plugin, PHP code, or user settings, hiding the admin bar is quick and easy.

By following this guide, you can create a cleaner and more professional experience for your users—and keep full control over your WordPress site’s appearance.

If you found this tutorial helpful, feel free to share it! And if you want more WordPress tips, tricks, and tutorials, check out blog page.

Table of Contents

Share:
Need certified web experts for your business?

With years of experience in Shopify, WordPress and Webflow web development, we offer top-tier solutions tailored to your needs. Book a free call today!

or