How do I remove the admin bar (styling) from frontend only?

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' );

Edit:

As @Walf suggested in the comments, this could be writen as:

add_filter('show_admin_bar', 'is_blog_admin');

Leave a Comment