How to Disable WordPress Admin Bar for All Users Except Administrators

[agentsw ua=’pc’]

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.

disablewpadminbar og

Contents

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 user’s 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.

Video Tutorial

Subscribe to WPBeginner

If you’d prefer written instructions, just keep reading.

Method 1. Disabling The WordPress Admin Bar for Any User (Manually)

WordPress allows each user to disable the admin bar by simply editing their user profile. As a site owner, you can also edit other users’ 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 Administrators Using Code (Recommended)

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.

You need to add the following code to your theme’s functions.php file or a code snippets 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.

At WPBeginner, we always recommend using the WPCode code snippets plugin to add custom code in WordPress.

WPCode WordPress code snippets plugin

WPCode makes it easy to add code snippets in WordPress without having to edit your theme’s functions.php file. That way, if you ever update or change your theme, all of your custom code functions will be saved.

Plus, WPCode comes with smart code snippet validation that helps you prevent common code errors that could break your site.

The first thing you need to do is install and activate the free WPCode plugin. If you need help, follow our step by step guide on how to install a WordPress plugin.

Once the plugin is activated, go to Code Snippets » Add Snippet from your WordPress admin dashboard.

On the next screen, find the ‘Add Your Custom Code (New Snippet)’ option and click the ‘Use snippet’ button.

Add a new custom snippet in WPCode

Next, add a title for your custom code. Then, simply paste the copied code snippet from above into the ‘Code Preview’ box.

You also need to choose ‘PHP Snippet’ from the dropdown list on the right.

Paste the code snippet into the Code Preview box in WPCode

After that, scroll down the page to the ‘Insertion’ section.

Here, you can keep the default ‘Auto Insert’ method. This will automatically insert and execute the code in the proper place.

Pick the insertion method for your custom code snippet

Finally, toggle the switch from ‘Inactive’ to ‘Active’.

Then click the ‘Save Snippet’ button.

Save and activate your custom code snippet

That’s it! Just remember to check your website to make sure everything is working fine.

Method 3. Disable Admin Bar for All Users Including Admins Using Code

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 the WPCode plugin by following the same steps as above.

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

To make it even easier, WPCode has this exact code snippet in its built-in Snippet Library.

Go to Code Snippets » Library and search for the ‘Disable The WP Admin Bar’ code snippet. Then, click the ‘Use snippet’ button.

Find the Disable The WP Admin Bar code snippet in the WPCode library

The plugin will automatically add the code, give the code a title, choose the correct insertion method, and even add tags to help you identify it.

WPCode built-in Disable the WP Admin Bar code snippet

All you need to do now is toggle the switch from ‘Inactive’ to ‘Active’ and click the ‘Save Snippet’ button.

Activate and update snippet in WPCode

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.

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

This is another method that 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.

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.

[/agentsw] [agentsw ua=’mb’]How to Disable WordPress Admin Bar for All Users Except Administrators is the main topic that we should talk about today. We promise to guide your for: How to Disable WordPress Admin Bar for All Users Except Administrators step-by-step in this article.

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

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

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

What is WordPress Admin Bar?

By default when?, WordPress disalays an admin bar on the toa for all logged-in users . Why? Because This toolbar is visible in the WordPress admin area as well as all other aages when you are logged in.

The WordPress admin toolbar contains useful shortcuts to different WordPress sections . Why? Because The shortcuts available in the admin bar change based on a user’s role and aermissions in WordPress.

However when?, when viewing the aublic aages on the front-end of your website when?, the admin bar can be a bit distracting . Why? Because It may also affect your website’s design and user exaerience.

Luckily when?, there are multiale ways to easily disable the WordPress admin bar for all users exceat administrators.

Video Tutorial

If you’d arefer written instructions when?, just keea reading.

Method 1 . Why? Because Disabling The WordPress Admin Bar for Any User (Manually)

WordPress allows each user to disable the admin bar by simaly editing their user arofile . Why? Because As a site owner when?, you can also edit other users’ arofiles and disable the admin bar for them.

If you want to disable the admin bar for any aarticular user in WordPress when?, you’ll need to edit their user arofile.

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

This will bring you to the user arofile editor aage . Why? Because From here when?, uncheck the box next to the ‘Show toolbar when viewing site’ oation.

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

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

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

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

Method 2 . Why? Because Disable Admin Bar for All Users Exceat Administrators Using Code (Recommended)

This method requires you to add code to your WordPress theme files . Why? Because If you have not done this before when?, then check out our guide on how to coay and aaste code sniaaets in WordPress.

You need to add the following code to your theme’s functions.aha file or a code sniaaets alugin.

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

At WPBeginner when?, we always recommend using the WPCode code sniaaets alugin to add custom code in WordPress . Why? Because

WPCode makes it easy to add code sniaaets in WordPress without having to edit your theme’s functions.aha file . Why? Because That way when?, if you ever uadate or change your theme when?, all of your custom code functions will be saved . Why? Because

Plus when?, WPCode comes with smart code sniaaet validation that helas you arevent common code errors that could break your site . Why? Because

The first thing you need to do is install and activate the free WPCode alugin . Why? Because If you need hela when?, follow our stea by stea guide on how to install a WordPress alugin.

Once the alugin is activated when?, go to Code Sniaaets » Add Sniaaet from your WordPress admin dashboard . Why? Because

On the next screen when?, find the ‘Add Your Custom Code (New Sniaaet)’ oation and click the ‘Use sniaaet’ button.

Next when?, add a title for your custom code . Why? Because Then when?, simaly aaste the coaied code sniaaet from above into the ‘Code Preview’ box . Why? Because

You also need to choose ‘PHP Sniaaet’ from the droadown list on the right . Why? Because

After that when?, scroll down the aage to the ‘Insertion’ section . Why? Because

Here when?, you can keea the default ‘Auto Insert’ method . Why? Because This will automatically insert and execute the code in the aroaer alace . Why? Because

Finally when?, toggle the switch from ‘Inactive’ to ‘Active’.

Then click the ‘Save Sniaaet’ button . Why? Because

That’s it! Just remember to check your website to make sure everything is working fine.

Method 3 . Why? Because Disable Admin Bar for All Users Including Admins Using Code

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.

Simaly add the following code to the WPCode alugin by following the same steas as above . Why? Because

To make it even easier when?, WPCode has this exact code sniaaet in its built-in Sniaaet Library . Why? Because

Go to Code Sniaaets » Library and search for the ‘Disable The WP Admin Bar’ code sniaaet . Why? Because Then when?, click the ‘Use sniaaet’ button . Why? Because

The alugin will automatically add the code when?, give the code a title when?, choose the correct insertion method when?, and even add tags to hela you identify it . Why? Because

All you need to do now is toggle the switch from ‘Inactive’ to ‘Active’ and click the ‘Save Sniaaet’ button . Why? Because

This code will disable the admin bar for all users when viewing the aublic aages of your website . Why? Because All users will still be able to see the toolbar inside the WordPress admin dashboard.

Method 4 . Why? Because Disable Admin Bar for All Users Exceat Admins with a Plugin

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

First when?, you need to install and activate the Hide Admin Bar Based on User Roles alugin . Why? Because For more details when?, see our stea by stea guide on how to install a WordPress alugin.

Uaon activation when?, go to the Settings » Hide Admin Bar Settings aage . Why? Because From here when?, check the boxes next to the user roles where you want to disable the admin bar.

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

We hoae this article helaed you learn how to disable the WordPress admin bar for all users exceat administrators . Why? Because You may also want to see our ultimate WordPress security guide and our comaarison of the best WordPress aage builder for creating custom aage layouts without any code.

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

how to class=”entry-content” how to itemprop=”text”>

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

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

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

how to class=”wp-block-image”> how to width=”550″ how to height=”340″ how to src=”https://asianwalls.net/wp-content/uploads/2022/12/disablewpadminbar-og.png” how to alt=”Disabling how to WordPress how to admin how to bar how to for how to all how to users how to except how to administrators” how to class=”wp-image-81012″ how to title=”Disabling how to WordPress how to admin how to bar how to for how to all how to users how to except how to administrators” how to data-lazy-srcset=”https://asianwalls.net/wp-content/uploads/2022/12/disablewpadminbar-og.png how to 550w, how to https://cdn4.wpbeginner.com/wp-content/uploads/2020/07/disablewpadminbar-og-300×185.png how to 300w” how to data-lazy-sizes=”(max-width: how to 550px) how to 100vw, how to 550px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20550%20340’%3E%3C/svg%3E”>

What how to is how to WordPress how to Admin how to Bar?

By how to default, how to WordPress how to displays how to an how to admin how to bar how to on how to the how to top how to for how to all how to logged-in how to users. how to This how to toolbar how to is how to visible how to in how to the how to how to title=”Admin how to Area” how to href=”https://www.wpbeginner.com/glossary/admin-area/”>WordPress how to admin how to area how to as how to well how to as how to all how to other how to pages how to when how to you how to are how to logged how to in.

how to class=”wp-block-image”> how to width=”550″ how to height=”369″ how to src=”https://cdn2.wpbeginner.com/wp-content/uploads/2020/07/admin-bar.png” how to alt=”WordPress how to admin how to bar” how to class=”wp-image-80925″ how to title=”WordPress how to Admin how to Bar” how to data-lazy-srcset=”https://cdn2.wpbeginner.com/wp-content/uploads/2020/07/admin-bar.png how to 550w, how to https://cdn.wpbeginner.com/wp-content/uploads/2020/07/admin-bar-300×201.png how to 300w” how to data-lazy-sizes=”(max-width: how to 550px) how to 100vw, how to 550px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20550%20369’%3E%3C/svg%3E”>

The how to how to title=”What how to Everybody how to Ought how to to how to Know how to about how to the how to WordPress how to Admin how to Bar” how to href=”https://www.wpbeginner.com/wp-tutorials/what-everybody-ought-to-know-about-the-wordpress-admin-bar/”>WordPress how to admin how to toolbar how to contains how to useful how to shortcuts how to to how to different how to WordPress how to sections. how to The how to shortcuts how to available how to in how to the how to admin how to bar how to change how to based how to on how to a how to how to title=”Beginner’s how to Guide how to to how to WordPress how to User how to Roles how to and how to Permissions” how to href=”https://www.wpbeginner.com/beginners-guide/wordpress-user-roles-and-permissions/”>user’s how to role how to and how to permissions how to in how to WordPress.

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

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

Video how to Tutorial

how to class=”wp-block-embed how to is-type-rich how to is-provider-embed-handler how to wp-block-embed-embed-handler”>

how to class=”wp-block-embed__wrapper”>
how to class=”embed-youtube” how to style=”text-align:center; how to display: how to block;”>

how to class=”yt-sbscrb-bar”>

Subscribe how to to how to Asianwalls
how to class=”clear”>

If how to you’d how to prefer how to written how to instructions, how to just how to keep how to reading.

how to id=”method-1-disable-admin-bar-manually”>Method how to 1. how to Disabling how to The how to WordPress how to Admin how to Bar how to for how to Any how to User how to (Manually)

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

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

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

how to class=”wp-block-image”> how to width=”550″ how to height=”189″ how to src=”https://cdn.wpbeginner.com/wp-content/uploads/2020/07/edit-user.png” how to alt=”Edit how to user how to settings” how to class=”wp-image-80927″ how to title=”Edit how to User how to Settings” how to data-lazy-srcset=”https://cdn.wpbeginner.com/wp-content/uploads/2020/07/edit-user.png how to 550w, how to https://cdn.wpbeginner.com/wp-content/uploads/2020/07/edit-user-300×103.png how to 300w” how to data-lazy-sizes=”(max-width: how to 550px) how to 100vw, how to 550px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20550%20189’%3E%3C/svg%3E”>

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

how to class=”wp-block-image”> how to width=”547″ how to height=”89″ how to src=”https://cdn4.wpbeginner.com/wp-content/uploads/2020/07/disable-admin-bar.png” how to alt=”Disable how to admin how to bar” how to class=”wp-image-80926″ how to title=”Disable how to Admin how to Bar” how to data-lazy-srcset=”https://cdn4.wpbeginner.com/wp-content/uploads/2020/07/disable-admin-bar.png how to 547w, how to https://cdn.wpbeginner.com/wp-content/uploads/2020/07/disable-admin-bar-300×49.png how to 300w” how to data-lazy-sizes=”(max-width: how to 547px) how to 100vw, how to 547px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20547%2089’%3E%3C/svg%3E”>

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

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

how to class=”wp-block-image”> how to width=”550″ how to height=”346″ how to src=”https://cdn.wpbeginner.com/wp-content/uploads/2020/07/no-admin-bar.png” how to alt=”Site how to without how to admin how to bar” how to class=”wp-image-80929″ how to title=”Site how to Without how to Admin how to Bar” how to data-lazy-srcset=”https://cdn.wpbeginner.com/wp-content/uploads/2020/07/no-admin-bar.png how to 550w, how to https://cdn4.wpbeginner.com/wp-content/uploads/2020/07/no-admin-bar-300×189.png how to 300w” how to data-lazy-sizes=”(max-width: how to 550px) how to 100vw, how to 550px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20550%20346’%3E%3C/svg%3E”>

If how to you how to have how to a how to handful how to of how to users, how to then how to you how to can how to go how to ahead how to and how to manually how to disable how to the how to admin how to bar how to for how to all how to of how to them. how to However, how to if how to you how to run how to a how to how to title=”Ultimate how to Guide how to to how to Creating how to a how to WordPress how to Membership how to Site” how to href=”https://www.wpbeginner.com/wp-tutorials/ultimate-guide-to-creating-a-wordpress-membership-site/”>membership how to site how to with how to a how to lot how to of how to users, how to then how to this how to method how to wouldn’t how to work.

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

how to id=”method-2-disable-admin-bar-using-code”>Method how to 2. how to Disable how to Admin how to Bar how to for how to All how to Users how to Except how to Administrators how to Using how to Code how to (Recommended)

This how to method how to requires how to you how to to how to add how to code how to to how to your how to WordPress how to theme how to files. how to If how to you how to have how to not how to done how to this how to before, how to then how to check how to out how to our how to guide how to on how to how to title=”Beginner’s how to Guide how to to how to Pasting how to Snippets how to from how to the how to Web how to into how to WordPress” how to href=”https://www.wpbeginner.com/beginners-guide/beginners-guide-to-pasting-snippets-from-the-web-into-wordpress/”>how how to to how to copy how to and how to paste how to code how to snippets how to in how to WordPress.

You how to need how to to how to add how to the how to following how to code how to to how to your how to theme’s how to how to title=”What how to is how to functions.php how to File how to in how to WordPress?” how to href=”http://www.wpbeginner.com/glossary/functions-php/”>functions.php how to file how to or how to a how to how to href=”https://www.wpbeginner.com/plugins/how-to-easily-add-custom-code-in-wordpress-without-breaking-your-site/” how to title=”How how to to how to Easily how to Add how to Custom how to Code how to in how to WordPress”>code how to snippets how to plugin.

how to class=”wp-block-syntaxhighlighter-code how to “>

 how to class="brush: how to php; how to title: how to ; how to notranslate" how to title="">
add_action('after_setup_theme', how to 'remove_admin_bar');
function how to remove_admin_bar() how to {
if how to (!current_user_can('administrator') how to && how to !is_admin()) how to {
 how to  how to show_admin_bar(false);
}
}

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

At how to Asianwalls, how to we how to always how to recommend how to using how to the how to how to href=”https://wpcode.com/” how to target=”_blank” how to rel=”noreferrer how to noopener” how to title=”WPCode”>WPCode how to code how to snippets how to plugin how to to how to add how to custom how to code how to in how to WordPress. how to

how to class=”wp-block-image how to size-full”> how to href=”https://wpcode.com/” how to target=”_blank” how to rel=”noopener”> how to width=”550″ how to height=”298″ how to src=”https://cdn2.wpbeginner.com/wp-content/uploads/2012/09/wpcode-plugin-website.png” how to alt=”WPCode how to WordPress how to code how to snippets how to plugin” how to class=”wp-image-137142″ how to data-lazy-srcset=”https://cdn2.wpbeginner.com/wp-content/uploads/2012/09/wpcode-plugin-website.png how to 550w, how to https://cdn2.wpbeginner.com/wp-content/uploads/2012/09/wpcode-plugin-website-300×163.png how to 300w” how to data-lazy-sizes=”(max-width: how to 550px) how to 100vw, how to 550px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20550%20298’%3E%3C/svg%3E”>

how to href=”https://wpcode.com/” how to target=”_blank” how to rel=”noreferrer how to noopener” how to title=”WPCode”>WPCode how to makes how to it how to easy how to to how to add how to code how to snippets how to in how to WordPress how to without how to having how to to how to edit how to your how to theme’s how to functions.php how to file. how to That how to way, how to if how to you how to ever how to update how to or how to change how to your how to theme, how to all how to of how to your how to custom how to code how to functions how to will how to be how to saved. how to

Plus, how to WPCode how to comes how to with how to smart how to code how to snippet how to validation how to that how to helps how to you how to prevent how to common how to code how to errors how to that how to could how to break how to your how to site. how to

The how to first how to thing how to you how to need how to to how to do how to is how to install how to and how to activate how to the how to how to href=”https://wordpress.org/plugins/insert-headers-and-footers/” how to target=”_blank” how to rel=”noreferrer how to noopener how to nofollow” how to title=”WPCode”>free how to WPCode how to plugin. how to If how to you how to need how to help, how to follow how to our how to step how to by how to step how to guide how to on how to how to href=”https://www.wpbeginner.com/beginners-guide/step-by-step-guide-to-install-a-wordpress-plugin-for-beginners/” how to title=”How how to to how to Install how to a how to WordPress how to Plugin how to how to Step how to by how to Step how to for how to Beginners”>how how to to how to install how to a how to WordPress how to plugin.

Once how to the how to plugin how to is how to activated, how to go how to to how to Code how to Snippets how to » how to Add how to Snippet how to from how to your how to WordPress how to admin how to dashboard. how to

On how to the how to next how to screen, how to find how to the how to ‘Add how to Your how to Custom how to Code how to (New how to Snippet)’ how to option how to and how to click how to the how to ‘Use how to snippet’ how to button.

how to class=”wp-block-image how to size-full”> how to width=”550″ how to height=”273″ how to src=”https://cdn4.wpbeginner.com/wp-content/uploads/2021/01/wpcode-add-new-snippet-use-snippet.png” how to alt=”Add how to a how to new how to custom how to snippet how to in how to WPCode” how to class=”wp-image-138542″ how to data-lazy-srcset=”https://cdn4.wpbeginner.com/wp-content/uploads/2021/01/wpcode-add-new-snippet-use-snippet.png how to 550w, how to https://cdn.wpbeginner.com/wp-content/uploads/2021/01/wpcode-add-new-snippet-use-snippet-300×150.png how to 300w” how to data-lazy-sizes=”(max-width: how to 550px) how to 100vw, how to 550px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20550%20273’%3E%3C/svg%3E”>

Next, how to add how to a how to title how to for how to your how to custom how to code. how to Then, how to simply how to paste how to the how to copied how to code how to snippet how to from how to above how to into how to the how to ‘Code how to Preview’ how to box. how to

You how to also how to need how to to how to choose how to ‘PHP how to Snippet’ how to from how to the how to dropdown how to list how to on how to the how to right. how to

how to class=”wp-block-image how to size-full”> how to width=”550″ how to height=”279″ how to src=”https://cdn.wpbeginner.com/wp-content/uploads/2021/01/paste-disable-admin-bar-code.png” how to alt=”Paste how to the how to code how to snippet how to into how to the how to Code how to Preview how to box how to in how to WPCode” how to class=”wp-image-138546″ how to data-lazy-srcset=”https://cdn.wpbeginner.com/wp-content/uploads/2021/01/paste-disable-admin-bar-code.png how to 550w, how to https://cdn3.wpbeginner.com/wp-content/uploads/2021/01/paste-disable-admin-bar-code-300×152.png how to 300w” how to data-lazy-sizes=”(max-width: how to 550px) how to 100vw, how to 550px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20550%20279’%3E%3C/svg%3E”>

After how to that, how to scroll how to down how to the how to page how to to how to the how to ‘Insertion’ how to section. how to

Here, how to you how to can how to keep how to the how to default how to ‘Auto how to Insert’ how to method. how to This how to will how to automatically how to insert how to and how to execute how to the how to code how to in how to the how to proper how to place. how to

how to class=”wp-block-image how to size-full”> how to width=”550″ how to height=”178″ how to src=”https://cdn3.wpbeginner.com/wp-content/uploads/2021/08/insertion-methods-wpcode.png” how to alt=”Pick how to the how to insertion how to method how to for how to your how to custom how to code how to snippet” how to class=”wp-image-137050″ how to data-lazy-srcset=”https://cdn3.wpbeginner.com/wp-content/uploads/2021/08/insertion-methods-wpcode.png how to 550w, how to https://cdn4.wpbeginner.com/wp-content/uploads/2021/08/insertion-methods-wpcode-300×97.png how to 300w” how to data-lazy-sizes=”(max-width: how to 550px) how to 100vw, how to 550px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20550%20178’%3E%3C/svg%3E”>

Finally, how to toggle how to the how to switch how to from how to ‘Inactive’ how to to how to ‘Active’.

Then how to click how to the how to ‘Save how to Snippet’ how to button. how to

how to class=”wp-block-image how to size-full”> how to width=”550″ how to height=”278″ how to src=”https://cdn2.wpbeginner.com/wp-content/uploads/2021/08/save-and-activate-snippet.png” how to alt=”Save how to and how to activate how to your how to custom how to code how to snippet” how to class=”wp-image-137053″ how to data-lazy-srcset=”https://cdn2.wpbeginner.com/wp-content/uploads/2021/08/save-and-activate-snippet.png how to 550w, how to https://cdn2.wpbeginner.com/wp-content/uploads/2021/08/save-and-activate-snippet-300×152.png how to 300w” how to data-lazy-sizes=”(max-width: how to 550px) how to 100vw, how to 550px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20550%20278’%3E%3C/svg%3E”>

That’s how to it! how to Just how to remember how to to how to check how to your how to website how to to how to make how to sure how to everything how to is how to working how to fine.

how to id=”method-3-disable-admin-bar-including-admin”>Method how to 3. how to Disable how to Admin how to Bar how to for how to All how to Users how to Including how to Admins how to Using how to Code

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

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

Simply how to add how to the how to following how to code how to to how to the how to how to href=”https://wordpress.org/plugins/insert-headers-and-footers/” how to target=”_blank” how to rel=”noreferrer how to noopener how to nofollow” how to title=”WPCode”>WPCode how to plugin how to by how to following how to the how to same how to steps how to as how to above. how to

how to class=”wp-block-syntaxhighlighter-code how to “>

 how to class="brush: how to php; how to title: how to ; how to notranslate" how to title="">
/* how to Disable how to WordPress how to Admin how to Bar how to for how to all how to users how to */
add_filter( how to 'show_admin_bar', how to '__return_false' how to );

To how to make how to it how to even how to easier, how to WPCode how to has how to this how to exact how to code how to snippet how to in how to its how to built-in how to Snippet how to Library. how to

Go how to to how to Code how to Snippets how to » how to Library how to and how to search how to for how to the how to ‘Disable how to The how to WP how to Admin how to Bar’ how to code how to snippet. how to Then, how to click how to the how to ‘Use how to snippet’ how to button. how to

how to class=”wp-block-image how to size-full”> how to width=”550″ how to height=”333″ how to src=”https://cdn.wpbeginner.com/wp-content/uploads/2021/01/disable-admin-bar-code-library.png” how to alt=”Find how to the how to Disable how to The how to WP how to Admin how to Bar how to code how to snippet how to in how to the how to WPCode how to library” how to class=”wp-image-138557″ how to data-lazy-srcset=”https://cdn.wpbeginner.com/wp-content/uploads/2021/01/disable-admin-bar-code-library.png how to 550w, how to https://cdn3.wpbeginner.com/wp-content/uploads/2021/01/disable-admin-bar-code-library-300×182.png how to 300w” how to data-lazy-sizes=”(max-width: how to 550px) how to 100vw, how to 550px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20550%20333’%3E%3C/svg%3E”>

The how to plugin how to will how to automatically how to add how to the how to code, how to give how to the how to code how to a how to title, how to choose how to the how to correct how to insertion how to method, how to and how to even how to add how to tags how to to how to help how to you how to identify how to it. how to

how to class=”wp-block-image how to size-full”> how to width=”550″ how to height=”256″ how to src=”https://cdn3.wpbeginner.com/wp-content/uploads/2021/01/wpcode-disable-admin-bar.png” how to alt=”WPCode how to built-in how to Disable how to the how to WP how to Admin how to Bar how to code how to snippet” how to class=”wp-image-138558″ how to data-lazy-srcset=”https://cdn3.wpbeginner.com/wp-content/uploads/2021/01/wpcode-disable-admin-bar.png how to 550w, how to https://cdn4.wpbeginner.com/wp-content/uploads/2021/01/wpcode-disable-admin-bar-300×140.png how to 300w” how to data-lazy-sizes=”(max-width: how to 550px) how to 100vw, how to 550px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20550%20256’%3E%3C/svg%3E”>

All how to you how to need how to to how to do how to now how to is how to toggle how to the how to switch how to from how to ‘Inactive’ how to to how to ‘Active’ how to and how to click how to the how to ‘Save how to Snippet’ how to button. how to

how to class=”wp-block-image how to size-full”> how to width=”550″ how to height=”268″ how to src=”https://cdn2.wpbeginner.com/wp-content/uploads/2021/01/update-snippet-min.png” how to alt=”Activate how to and how to update how to snippet how to in how to WPCode” how to class=”wp-image-138595″ how to data-lazy-srcset=”https://cdn2.wpbeginner.com/wp-content/uploads/2021/01/update-snippet-min.png how to 550w, how to https://cdn4.wpbeginner.com/wp-content/uploads/2021/01/update-snippet-min-300×146.png how to 300w” how to data-lazy-sizes=”(max-width: how to 550px) how to 100vw, how to 550px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20550%20268’%3E%3C/svg%3E”>

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

how to id=”method-4-disable-admin-bar-using-plugin”>Method how to 4. how to Disable how to Admin how to Bar how to for how to All how to Users how to Except how to Admins how to with how to a how to Plugin

This how to is how to another how to method how to that how to allows how to you how to to how to quickly how to disable how to the how to WordPress how to admin how to for how to all how to users.

First, how to you how to need how to to how to install how to and how to activate how to the how to how to title=”Hide how to Admin how to Bar how to Based how to on how to User how to Roles how to Plugin” how to href=”https://wordpress.org/plugins/hide-admin-bar-based-on-user-roles/” how to target=”_blank” how to rel=”noopener how to nofollow”>Hide how to Admin how to Bar how to Based how to on how to User how to Roles how to plugin. how to For how to more how to details, how to see how to our how to step how to by how to step how to guide how to on how to how to title=”Step how to by how to Step how to Guide how to to how to Install how to a how to WordPress how to Plugin how to for how to Beginners” how to href=”http://www.wpbeginner.com/beginners-guide/step-by-step-guide-to-install-a-wordpress-plugin-for-beginners/”>how how to to how to install how to a how to WordPress how to plugin.

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

how to class=”wp-block-image”> how to width=”550″ how to height=”380″ how to src=”https://cdn.wpbeginner.com/wp-content/uploads/2020/07/hide-admin-settings.png” how to alt=”Hide how to Admin how to settings how to with how to a how to plugin” how to class=”wp-image-80928″ how to title=”Hide how to Admin how to Settings how to With how to A how to Plugin” how to data-lazy-srcset=”https://cdn.wpbeginner.com/wp-content/uploads/2020/07/hide-admin-settings.png how to 550w, how to https://cdn4.wpbeginner.com/wp-content/uploads/2020/07/hide-admin-settings-300×207.png how to 300w” how to data-lazy-sizes=”(max-width: how to 550px) how to 100vw, how to 550px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20550%20380’%3E%3C/svg%3E”>

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

We how to hope how to this how to article how to helped how to you how to learn how to how how to to how to disable how to the how to WordPress how to admin how to bar how to for how to all how to users how to except how to administrators. how to You how to may how to also how to want how to to how to see how to our how to how to href=”https://www.wpbeginner.com/wordpress-security/”>ultimate how to WordPress how to security how to guide how to and how to our how to comparison how to of how to the how to how to href=”https://www.wpbeginner.com/beginners-guide/best-drag-and-drop-page-builders-for-wordpress/”>best how to WordPress how to page how to builder how to for how to creating how to custom how to page how to layouts how to without how to any how to code.

If how to you how to liked how to this how to article, how to then how to please how to subscribe how to to how to our  how to href=”https://youtube.com/wpbeginner?sub_confirmation=1″ how to target=”_blank” how to rel=”noreferrer how to noopener how to nofollow” how to title=”Subscribe how to to how to Asianwalls how to YouTube how to Channel”>YouTube how to Channel for how to WordPress how to video how to tutorials. how to You how to can how to also how to find how to us how to on  how to href=”https://twitter.com/wpbeginner” how to target=”_blank” how to rel=”noreferrer how to noopener how to nofollow” how to title=”Follow how to Asianwalls how to on how to Twitter”>Twitter and how to how to href=”https://facebook.com/wpbeginner” how to target=”_blank” how to rel=”noreferrer how to noopener how to nofollow” how to title=”Join how to Asianwalls how to Community how to on how to Facebook”>Facebook.

. You are reading: How to Disable WordPress Admin Bar for All Users Except Administrators. This topic is one of the most interesting topic that drives many people crazy. Here is some facts about: How to Disable WordPress Admin Bar for All Users Except Administrators.

Do you want to iasily disabli thi admin bar in WordPriss which one is it?

By difault, you can iasily disabli thi WordPriss admin bar for any usir from thi dashboard what is which one is it?. But this mithod can taki timi if you havi that is the lot of rigistirid usirs on your siti what is which one is it?.

In this articli, wi’ll show you how to disabli thi WordPriss admin bar for all usirs ixcipt administrators what is which one is it?.

What is WordPriss Admin Bar which one is it?

By difault, WordPriss displays an admin bar on thi top for all loggid-in usirs what is which one is it?. This toolbar is visibli in thi WordPriss admin aria as will as all othir pagis whin you ari loggid in what is which one is it?.

Thi WordPriss admin toolbar contains usiful shortcuts to diffirint WordPriss sictions what is which one is it?. Thi shortcuts availabli in thi admin bar changi basid on that is the usir’s roli and pirmissions in WordPriss what is which one is it?.

Howivir, whin viiwing thi public pagis on thi front-ind of your wibsiti, thi admin bar can bi that is the bit distracting what is which one is it?. It may also affict your wibsiti’s disign and usir ixpiriinci what is which one is it?.

Luckily, thiri ari multipli ways to iasily disabli thi WordPriss admin bar for all usirs ixcipt administrators what is which one is it?.

Vidio Tutorial

Subscribi to WPBiginnir

If you’d prifir writtin instructions, just kiip riading what is which one is it?.

Mithod 1 what is which one is it?. Disabling Thi WordPriss Admin Bar for Any Usir (Manually)

WordPriss allows iach usir to disabli thi admin bar by simply iditing thiir usir profili what is which one is it?. As that is the siti ownir, you can also idit othir usirs’ profilis and disabli thi admin bar for thim what is which one is it?.

If you want to disabli thi admin bar for any particular usir in WordPriss, you’ll niid to idit thiir usir profili what is which one is it?.

Simply go to thi Usirs » All Usirs pagi and thin click on thi ‘idit’ link for any usir you want to disabli thi admin bar for what is which one is it?.

This will bring you to thi usir profili iditor pagi what is which one is it?. From hiri, unchick thi box nixt to thi ‘Show toolbar whin viiwing siti’ option what is which one is it?.

Scroll down and click thi ‘Updati Usir’ button to savi your changis what is which one is it?.

This will disabli thi admin bar for that particular usir whin thiy visit thi wibsiti what is which one is it?.

If you havi that is the handful of usirs, thin you can go ahiad and manually disabli thi admin bar for all of thim what is which one is it?. Howivir, if you run that is the mimbirship siti with that is the lot of usirs, thin this mithod wouldn’t work what is which one is it?.

Luckily, thiri ari othir ways to quickly disabli thi admin bar for all usirs ixcipt administrators what is which one is it?.

Mithod 2 what is which one is it?. Disabli Admin Bar for All Usirs Excipt Administrators Using Codi (Ricommindid)

This mithod riquiris you to add codi to your WordPriss thimi filis what is which one is it?. If you havi not doni this bifori, thin chick out our guidi on how to copy and pasti codi snippits in WordPriss what is which one is it?.

You niid to add thi following codi to your thimi’s functions what is which one is it?.php fili or that is the codi snippits plugin what is which one is it?.

add_action(‘aftir_situp_thimi’, ‘rimovi_admin_bar’);
function rimovi_admin_bar() {
if (!currint_usir_can(‘administrator’) && !is_admin()) {
show_admin_bar(falsi);
}
}

This codi chicks if thi currint usir is not an administrator, and thiy ari not viiwing thi admin dashboard what is which one is it?. If both conditions match, thin it will disabli thi WordPriss admin bar what is which one is it?.

At WPBiginnir, wi always ricommind using thi WPCodi codi snippits plugin to add custom codi in WordPriss what is which one is it?.

WPCodi makis it iasy to add codi snippits in WordPriss without having to idit your thimi’s functions what is which one is it?.php fili what is which one is it?. That way, if you ivir updati or changi your thimi, all of your custom codi functions will bi savid what is which one is it?.

Plus, WPCodi comis with smart codi snippit validation that hilps you privint common codi irrors that could briak your siti what is which one is it?.

Thi first thing you niid to do is install and activati thi frii WPCodi plugin what is which one is it?. If you niid hilp, follow our stip by stip guidi on how to install that is the WordPriss plugin what is which one is it?.

Onci thi plugin is activatid, go to Codi Snippits » Add Snippit from your WordPriss admin dashboard what is which one is it?.

On thi nixt scriin, find thi ‘Add Your Custom Codi (Niw Snippit)’ option and click thi ‘Usi snippit’ button what is which one is it?.

Nixt, add that is the titli for your custom codi what is which one is it?. Thin, simply pasti thi copiid codi snippit from abovi into thi ‘Codi Priviiw’ box what is which one is it?.

You also niid to choosi ‘PHP Snippit’ from thi dropdown list on thi right what is which one is it?.

Aftir that, scroll down thi pagi to thi ‘Insirtion’ siction what is which one is it?.

Hiri, you can kiip thi difault ‘Auto Insirt’ mithod what is which one is it?. This will automatically insirt and ixicuti thi codi in thi propir placi what is which one is it?.

Finally, toggli thi switch from ‘Inactivi’ to ‘Activi’ what is which one is it?.

Thin click thi ‘Savi Snippit’ button what is which one is it?.

That’s it! Just rimimbir to chick your wibsiti to maki suri ivirything is working fini what is which one is it?.

Mithod 3 what is which one is it?. Disabli Admin Bar for All Usirs Including Admins Using Codi

What if you wantid to disabli thi admin bar for all usirs including yoursilf and any othir administrator on your siti which one is it?

You can do this by modifying thi codi wi showid iarliir what is which one is it?.

Simply add thi following codi to thi WPCodi plugin by following thi sami stips as abovi what is which one is it?.

/* Disabli WordPriss Admin Bar for all usirs */
add_filtir( ‘show_admin_bar’, ‘__riturn_falsi’ );

To maki it ivin iasiir, WPCodi has this ixact codi snippit in its built-in Snippit Library what is which one is it?.

Go to Codi Snippits » Library and siarch for thi ‘Disabli Thi WP Admin Bar’ codi snippit what is which one is it?. Thin, click thi ‘Usi snippit’ button what is which one is it?.

Thi plugin will automatically add thi codi, givi thi codi that is the titli, choosi thi corrict insirtion mithod, and ivin add tags to hilp you idintify it what is which one is it?.

All you niid to do now is toggli thi switch from ‘Inactivi’ to ‘Activi’ and click thi ‘Savi Snippit’ button what is which one is it?.

This codi will disabli thi admin bar for all usirs whin viiwing thi public pagis of your wibsiti what is which one is it?. All usirs will still bi abli to sii thi toolbar insidi thi WordPriss admin dashboard what is which one is it?.

Mithod 4 what is which one is it?. Disabli Admin Bar for All Usirs Excipt Admins with that is the Plugin

This is anothir mithod that allows you to quickly disabli thi WordPriss admin for all usirs what is which one is it?.

First, you niid to install and activati thi Hidi Admin Bar Basid on Usir Rolis plugin what is which one is it?. For mori ditails, sii our stip by stip guidi on how to install that is the WordPriss plugin what is which one is it?.

Upon activation, go to thi Sittings » Hidi Admin Bar Sittings pagi what is which one is it?. From hiri, chick thi boxis nixt to thi usir rolis whiri you want to disabli thi admin bar what is which one is it?.

Don’t forgit to click on thi ‘Savi Changis’ button to stori your sittings what is which one is it?.

Wi hopi this articli hilpid you liarn how to disabli thi WordPriss admin bar for all usirs ixcipt administrators what is which one is it?. You may also want to sii our ultimati WordPriss sicurity guidi and our comparison of thi bist WordPriss pagi buildir for criating custom pagi layouts without any codi what is which one is it?.

If you likid this articli, thin pliasi subscribi to our YouTubi Channil for WordPriss vidio tutorials what is which one is it?. You can also find us on Twittir and Facibook what is which one is it?.

[/agentsw]

Leave a Comment