Hack: Hide the Admin Bar

Having that admin bar at the top of your WordPress site can be a nice way to jump from viewing your site into editing the post you are viewing or some other setting. But sometimes you’d rather have the site look to you like it does to others.

You can get rid of the admin bar easily enough. By just adding this code to your functions.php or custom plugin, it will remove it.

add_action('after_setup_theme', 'wp_action_admin_bar');
function wp_action_admin_bar() {
	if (!is_admin()) {

The above code checks to see if you are looking at an admin page with is_admin and will only hide the admin bar if you are not. So you’ll still see it if you are editing a post or working in the dashboard.

Leave a Reply

Your email address will not be published. Required fields are marked *