How to Hide WordPress Admin Bar: With or Without Plugin

Team DiviFlash

Updated: October 15, 2024
Table of Contents

The WordPress admin bar offers quick access to key dashboard features like Dashboard, Edit Post, and Customize. While it’s useful for logged-in users, it can also clutter the screen and distract visitors.

In this guide, we’ll explore the two most effective methods to hide the admin bar from your WordPress dashboard, which can improve the user experience and at the same time enhance website security.

Let’s get started.

Method 1: Hide the WordPress Admin Bar Using a Plugin

The simplest way to disable the WordPress admin bar is through a plugin. We recommend using DiviFlash, which lets you hide the admin bar based on user roles. Typically, the WordPress admin bar is hidden for all users except administrators. Here’s how to do it:

First, purchase the DiviFlash plugin from their websites. Then navigate to your WordPress Dashboard and follow the instructions below,

  • Go to Plugins > Add New Plugin.
  • Click Upload Plugin and choose Choose File.
  • Select the DiviFlash Plugin ZIP file and click Install Now.
  • After successful installation, click “Activate” to activate the DiviFlash plugins.
  • From your WordPress dashboard, navigate to DiviFlash > Settings > General Settings.
  • Enable the Hide Admin Bar option. This way you can disable the WordPress admin bar for all users or for specific roles. 

Note: If you want to bring back the admin bar, simply go back to the settings menu, uncheck the box, and save your changes.

Method 2: Hide the WordPress Admin Bar Without Plugin

If you want to hide the WordPress admin bar manually you have two options,

  • From user settings
  • Using PHP code

Hide Admin Bar From the User Settings

As an admin, you can easily disable the WordPress admin bar for non-admin WordPress users or any specific users through the account settings. Here’s how to do it:

  • Log in to the WordPress admin dashboard.
  • From your WordPress dashboard navigate to Users > All Users.
  • Hover over the user you want to hide the admin bar and click Edit.
  • Look for the Toolbar setting and untick the box. 
  • Scroll to the bottom and click “Update User” to save your changes.

Hide Admin Bar Using Code

If you’re comfortable with the code and don’t want plugin dependency, you can easily remove the admin bar for your WordPress user by modifying the code in your functions.php file. Here’s how to do it:

  • From your WordPress dashboard navigate to Appearance > Theme File Editor.
  • Select the functions.php from the Theme Files
  • Add the following snippet at the bottom of the code editor.
  • Once done, click the Update File

If you want to hide the admin bar for all users, use the following code:

phpadd_filter(‘show_admin_bar’, ‘__return_false’);

If you want to disable the WordPress admin bar for all users except administrators, use the following code:

phpadd_action(‘after_setup_theme’, ‘remove_admin_bar’);function remove_admin_bar() {    if (!current_user_can(‘administrator’) && !is_admin()) {        show_admin_bar(false);    }}

If you want to disable the admin bar WordPress for subscribers use the following code:

php
if (current_user_can(‘subscriber’)) {
    add_filter(‘show_admin_bar’, ‘__return_false’);}

Note: To reverse the changes, simply remove the code from the code editor and save the changes.

Why Should You Hide WordPress Admin Bar?

Hiding the WordPress admin bar can be beneficial for several reasons. Here are some common reasons you might want to do this:

  • Enhances security: It helps enhance security by restricting unnecessary access to the dashboard, particularly for non-admin users like subscribers or customers who do not need administrative tools.
  • Improves user experience: For visitors who are not logged in, the admin bar can clutter the screen and distract from the main content. Hiding it can create a cleaner and more focused user experience.
  • Streamlines navigation: Reduces clutter on the screen, making it easier for users to navigate the site.
  • Facilitates development: For developers and designers, hiding the admin bar can facilitate a more holistic view of the website’s design and layout during the development and testing phases.

Conclusion

By following the steps outlined in this guide, you can easily hide the WordPress admin bar from your dashboard. This can enhance the user experience, improve website security, and create a cleaner, more focused appearance for your site. 

Choose the method that best suits your needs and preferences, and enjoy the benefits of a clutter-free WordPress dashboard. However, our recommendation will be to use the DiviFlash plugin. This method is ideal for beginners with no coding experience. 

That said, DiviFlash is more than just a tool for hiding the admin bar; it’s a powerful Divi plugin that enhances your website building with over 50 Divi modules, extensions, and premade layouts.

Team DiviFlash

At DiviFlash, we are more than just a team – we are a collective of Dev Experts, Word Artists, Design Virtuosos, and Marketing Maestros, all united by our profound expertise in Divi and WordPress. Our mission is to provide you with accurate, insightful, and in-depth content aimed at enriching your understanding of Divi, WordPress, and the art of web design.

0 Comments

Submit a Comment

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