The WordPress Admin Bar can be handy for webmasters when they want to quickly flick back and forward between the front-end and the WordPress admin section, however sometimes you don’t want it to show on the front end at all.
The WordPress Admin Bar can be handy for webmasters when they want to quickly flick back and forward between the front-end and the WordPress admin section, however sometimes you don’t want it to show on the front end at all.
This is mainly when you have a members section on the website and you only want them to stay on the front end of the website. Obviously you would block their access to the backend, but you still don’t want the big ugly bar showing at the top of your nice website when they have logged in.
Here is a quick code snippet that you can place in your WordPress functions.php that will complete remove the Admin Bar altogether from the front-end.
You may also want to play around with a number of IF statements to target it only at specific users.
function hide_admin_bar_from_front_end(){
if (is_blog_admin()) {
return true;
}
return false;
}
add_filter( 'show_admin_bar', 'hide_admin_bar_from_front_end' );