Find out in this tutorial how to hide the top WordPress admin bar for all users except administrators using code.
If you have a membership site or an intranet, you may prefer to prevent the WordPress admin bar from appearing when your users log in to their account.
However, when you log in with an administrator profile, you do need it to be visible for quick access to WP-admin.
Do you want the WordPress admin bar to be displayed only to administrators and not to the rest of the logged in users?
I’m sure that what you’re going to learn today will come in handy.
Snippet to hide the top admin bar in WordPress except for admin users
Add the following code at the end of functions.php or in your functionality plugin:
It’s that simple, see?
If you want to hide the admin bar for all users you also have a tutorial. 😉
With a few lines of code you can make it so that only users with admin privileges can see the admin bar.
Any questions? Let me know in the comments.
And if you want to give me any suggestion for future tutorials, leave it in the contact form. Advantages of being a subscriber. 😉