Ventacademy
  • Socials
  • Business Fundamentals
    • Investments
  • High Income Skills
  • Programming
  • Software Review
  • Website Development
    • WordPress
    • Search Engine Optimization
    • Free Templates and Plugins
      • Support
  • Finance
No Result
View All Result
Knowledge base
No Result
View All Result
Home Wordpress

How to Disable WordPress Admin Bar for All Users Except Administrators

admin by admin
January 30, 2021
Share on FacebookShare on Twitter


Do you want to easily disable the admin bar in WordPress?

By default, you can easily disable the WordPress admin bar for any user from the dashboard. But this method can take time if you have a lot of registered users on your site.

In this article, we’ll show you how to disable the WordPress admin bar for all users except administrators.

What is WordPress Admin Bar?

By default, WordPress displays an admin bar on the top for all logged-in users. This toolbar is visible in the WordPress admin area as well as all other pages when you are logged in.

WordPress admin bar

The WordPress admin toolbar contains useful shortcuts to different WordPress sections. The shortcuts available in the admin bar change based on a users’ role and permissions in WordPress.

However, when viewing the public pages on the front-end of your website, the admin bar can be a bit distracting. It may also affect your website’s design and user experience.

Luckily, there are multiple ways to easily disable the WordPress admin bar for all users except administrators.

Method 1. Disabling The WordPress Admin Bar for Any User

WordPress allows each user to disable the admin bar by simply editing their user profile. As a site owner, you can also edit other user’s profiles and disable the admin bar for them.

If you want to disable the admin bar for any particular user in WordPress, you’ll need to edit their user profile.

Simply go to the Users » All Users page and then click on the ‘edit’ link for any user you want to disable the admin bar for.

Edit user settings

This will bring you to the user profile editor page. From here, uncheck the box next to the ‘Show toolbar when viewing site’ option.

Disable admin bar

Scroll down and click the ‘Update User’ button to save your changes.

This will disable the admin bar for that particular user when they visit the website.

Site without admin bar

If you have a handful of users, then you can go ahead and manually disable the admin bar for all of them. However, if you run a membership site with a lot of users, then this method wouldn’t work.

Luckily, there are other ways to quickly disable the admin bar for all users except administrators.

Method 2. Disable Admin Bar for All Users Except Admins with a Plugin

This method allows you to quickly disable the WordPress admin for all users.

First, you need to install and activate the Hide Admin Bar Based on User Roles plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Upon activation, go to the Settings » Hide Admin Bar Settings page. From here, check the boxes next to the user roles where you want to disable the admin bar.

Hide Admin settings with a plugin

Don’t forget to click on the ‘Save Changes’ button to store your settings.

Method 3. Disable Admin Bar for All Users Except Administrators Using Code

This method requires you to add code to your WordPress theme files. If you have not done this before, then check out our guide on how to copy and paste code snippets in WordPress.

Simply add the following code to your theme’s functions.php file or a site-specific plugin.

add_action('after_setup_theme', 'remove_admin_bar');
function remove_admin_bar() {
if (!current_user_can('administrator') && !is_admin()) {
  show_admin_bar(false);
}
}

This code checks if the current user is not an administrator, and they are not viewing the admin dashboard. If both conditions match, then it will disable the WordPress admin bar.

Don’t forget to save your changes and check your website to make sure everything is working fine.

Method 4. Disable Admin Bar for All Users Including Admins

What if you wanted to disable the admin bar for all users including yourself and any other administrator on your site?

You can do this by modifying the code we showed earlier.

Simply add the following code to your theme’s functions.php file or a site-specific plugin.

/* Disable WordPress Admin Bar for all users */
add_filter( 'show_admin_bar', '__return_false' );

This code will disable the admin bar for all users when viewing the public pages of your website. All users will still be able to see the toolbar inside the WordPress admin dashboard.

We hope this article helped you learn how to disable the WordPress admin bar for all users except administrators. You may also want to see our ultimate WordPress security guide and our comparison of the best WordPress page builder for creating custom page layouts without any code.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Disable WordPress Admin Bar for All Users Except Administrators appeared first on WPBeginner.



admin

admin

Related Posts

How to Change the Author of a Post in WordPress

April 22, 2021

How to Add a Custom Product Builder in WooCommerce

April 21, 2021

Beginner’s Guide on How to Add Business Hours in WordPress

April 20, 2021

How to See Old Versions of Any WordPress Site (3 Tools)

April 19, 2021
Next Post

No Sex Until We Are Vaccinated: Italian Politician Calls For Boycott Of Viagra - Foreign Affairs

Leave a Reply Cancel reply

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

Recommended.

2009 VS 2019 • By Annesmiles

January 5, 2021
Watercolor Painting Ideas with Robert Joyner

Watercolor Painting Ideas with Robert Joyner

December 16, 2020

Subscribe.

Trending.

No Content Available

About Us

Knowledge base

We bring you the best technology news, Finance news and lots more. you can download premium themes, plugins scripts, courses and lots more here.

Follow Us

Categories

  • All
  • Books
  • Business Fundamentals
  • Finance
  • Free Course
  • Free download
  • Free Templates and Plugins
  • Health
  • High Income Skills
  • Investments
  • NSFW
  • Photography
  • Search Engine Optimization
  • Software Review
  • Support
  • Technical Analysis
  • Website Development
  • Wordpress
  • World

Activity

FREEDOWNLOAD

Convert Pro 1.6.0 Nulled + Addon – Lead Generation Tool for WordPress

Spain In The EU

Tailwind CSS : The Complete Guide ( Project Included ) – Download Udemy Paid Courses For Free

React Next.js – Cookie Based Secure Authentication System – Download Udemy Paid Courses For Free

The Complete Node.js Developer Course (3rd Edition) – Download Udemy Paid Courses For Free

[PacktPub] Frontend Web Development Bootcamp – Build a Twitter Clone [Video] | PacktPub Free Courses Online Free Download Torrent

WP File Download 4.9.10 + Cloud Addon – File Manager WordPress Plugin

WP Media Folder 5.3.16 – WordPress Media Library

WPNotif 2.3.0.13 Nulled – WordPress SMS & WhatsApp Message Notifications

TotalContest Pro 2.3.1 – Photo, Audio and Video Contest WordPress Plugin

Jannah 5.4.2 Nulled – Newspaper Magazine News BuddyPress AMP

Mailster 2.4.18 Nulled – Email Newsletter Plugin for WordPress

Profile Builder Pro 3.4.3 Nulled – Profile Plugin for WordPress

Automatically generates native code for adding splash screens in Android and iOS

Vikinger 1.5.1 – BuddyPress and GamiPress Social Community

  • Socials
  • About
  • Advertise
  • Privacy & Policy
  • Contact

© 2020 Ventacademy

No Result
View All Result
  • Socials
  • Business Fundamentals
    • Investments
  • High Income Skills
  • Programming
  • Software Review
  • Website Development
    • WordPress
    • Search Engine Optimization
    • Free Templates and Plugins
      • Support

© 2020 Ventacademy