wphats

How to hide/disable admin bar from WordPress

How to hide/disable admin bar from WordPress

Sometimes we are not required to show admin bar from the front side of WP sites which likes odd if not necessary for all types of users. So, here are few tricks & functions which will allow you to do this:

 

hide-admin-bar

FORMULA-1 : Hook Function which you have to paste in functions.php file

# If want to hide for all types of users including administrators:

# If want to hide all types of users except administrators:

# Hide admin bar from subscribers:


FORMULA-2: ADD CSS & HOOK CSS CODE TO FUNCTION

#simply you can add this css code to your CSS file:

# hook action to functions.php file for adding css:

I hope you can find your suitable solution from the above and fulfill your requirements. Thanks.

This post has already been read 1200 times!

Mehedi Hasan

Cool WordPress Developer having much agile experience to develop any kind of WordPress sites & plugins. Also good in troubleshooting, fixing & making any kind of tweaks for WP site.

More Posts

POSTED ON: Wordpress Tricks
TAGGED :

Leave a Reply

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