Quickly Hide the WordPress Admin Bar When Logged In

June 25, 2013 Development, PHP, WordPress

When users are logged in at a website built on WordPress, they’ll see an admin bar at the top of the page by default. There are some cases where I’ve wanted to hide this bar and it’s rather easy to do.

Add this one line of code to your theme’s functions.php file.

PHP

add_filter('show_admin_bar', '__return_false');

There’s no need to use any CSS and this will work as long as the theme is enabled. Now if the admin bar is hiding the very top of your design or if website users don’t need the extra bar, it will be gone before you know it.

Let's Talk About Your New Website

View Portfolio Contact Today