Basic WordPress

Disable the Admin Bar on WordPress Theme

The red marked part of the image is the WordPress theme’s admin bar (: P tongue wrenching emo).

Though disable admin bar in WordPress is not a good practice. I have to keep it inactive sometimes for working purpose. Especially when working with sticky headers, the deactivation code of this one line is so useful for me. However, there are many other ways to get rid of these deactivations. There are many plugins to disable admin bar. You can also use plugins. However, I love this one line code.

Disable the Admin Bar

// Remove the admin bar from the front end
add_filter( 'show_admin_bar', '__return_false' );