how to hide the top admin bar at the frontend in WordPress
In default wordpress website, when we are login in a tab and looking at the frontend in another tab of same browser then a admin bar or we can say that a toolbar show at the top of our web page. Generally it is vey useful for developers or admin users of the website.
But we want to get rid of this to make our website more user friendly. So there are so many ways to hide or remove this admin bar at frontend. Here we are discussing about few of them :
From admin settings :
By this method we can disable this tool bar for some of our specific users. To do this just follow the below mentioned path :
<em>Go to admin => Users => Your Profile</em>
There is a toolbar option on the profile page, just uncheck the checkbox which is saying “Show toolbar when viewing site”. So, the toolbar for current user will not show untill we uncheck this checkbox again.
In the same way we can hide or disable this toolbar for any of the website users from their profile settings.
Using a plugin :
We can disable the toolbar by installing a plugin to the admin plugin section. There are so many plugins available to hide this toolbar permanently for all type of users. Just go to admin add new plugin section and search for “Global Hide Admin Toolbar” and install the plugin from it.
Using a css :
In this same reference, we can do this by adding a css to the style.css file of your activated theme. We can add below mentioned css :
#wpadminbar {display :none !important;}
But it is bad practice to hide the admin bar by using the above mentioned css.
Code in Functions.php :
It is the best way to hide the admin bar among all of the discussed above. We just need to put a line of code in our functions.php file of our currently activated theme. Use code :
<pre>add_filter('show_admin_bar', '__return_false');</pre>
putting the above mentioned code will hide the admin bar from the frontend and it will remain working for all admin pages, which is a most correct and easy way.
Choose a way of your choice and get rid of admin bar.. 🙂
Lot of thanks for share this article, this why worked. again thanks.
This post really helped me out though I had to remove tags “,” in the above code.
Thank you