How to Show Admin Bar to Administrators Only

| Last Updated: | In: WordPress, WordPress Snippets


Are you developing a WordPress website and want hide admin toolbar from front-end website for non-WordPress users. Open the functions.php file and copy paste below code at the end of the file and save it.

Below code will hide the admin toolbar to all logged in users except admins only.

This code is very useful for the membership website or those websites which allow user registration from front-end websites.

You can also do this by using a WordPress plugin named “Hide Admin Bar from Non-Admins“. This plugin will automatically remove the admin toolbar from front-end site. Download the latest version of this plugin from below link and install it into your website.

Download From WordPress.org

How to Install Hide Admin Bar from Non-Admins Plugin

The installation of this plugin is very simple and easy as other WordPress plugins are. If you have just started with WordPress, Read:

After installation of this plugin, no need to configure, It will automatically work.

Do you like & share this tutorial with your friends, and don’t forget to follow us on Facebook and Twitter to learn cool WordPress tutorials. Also, subscribe my blog to get every future WordPress tips and tricks directly in your mailbox.


About: Prem Tiwari

Prem Tiwari is the founder of freewebmentor.com and is a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby and also he has been a regular speaker of WordPress sessions in various IT Companies.


You may also like:


, , , , , ,