How to Remove Admin Bar For Subscribers

Sometimes we want to remove the admin tool from front-end websites based on the user role and permission on your site. In this post, I have explained the simple and easy codes to remove admin toolbar on the user role basis.


Show admin bar only for administrator

Use the below code at the end of the wp-content/themes/your-theme/functions.php file. It will remove the Admin toolbar for all users except the Administrators.

Show admin bar only for admins and editors

Below code will remove the Admin bar from front-end sites for Administrators as well editors of your web

Do you like & share this article with your friends, and don’t forget to follow us on Facebook and Twitter to learn cool WordPress tutorials.

If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.

Recommended Posts:

Prem Tiwari

An engineer by profession and a passionate blogger by heart. Founder of (A Programming blog for beginners), Tech Speaker at various forums. A part from this he is an open source enthusiast, WordPress Lover, Blogger, SEO, and Growth Strategic.

Article Tags: , , , ,