Title: show_admin_bar(false); doesn&#039;t work
Last modified: August 21, 2016

---

# show_admin_bar(false); doesn't work

 *  [joker1234](https://wordpress.org/support/users/joker1234/)
 * (@joker1234)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/show_admin_barfalse-doesnt-work/)
 * I tried to put show_admin_bar(false); anywhere but it doesn’t work. Is there 
   something I must do before?

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/show_admin_barfalse-doesnt-work/#post-4810498)
 * It should work on the front end. As of 3.3 you cannot remove it from the back
   end any more. If it really bothers you, you can hide it with CSS.
 *  Thread Starter [joker1234](https://wordpress.org/support/users/joker1234/)
 * (@joker1234)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/show_admin_barfalse-doesnt-work/#post-4810542)
 * It doesn’t work anywhere.
 *  [andrei1709](https://wordpress.org/support/users/andrei1709/)
 * (@andrei1709)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/show_admin_barfalse-doesnt-work/#post-4810601)
 * go to /wp-includes/css/admin-bar.min.css
 * and add this:
 *     ```
       #wpadminbar {
         display: none;
       }
       ```
   
 * the exact CSS path is `html body.home div#wpadminbar.no-grav`
 *  Thread Starter [joker1234](https://wordpress.org/support/users/joker1234/)
 * (@joker1234)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/show_admin_barfalse-doesnt-work/#post-4810614)
 * Yes, but this leaves a gap of 32px on the top of the body.
 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/show_admin_barfalse-doesnt-work/#post-4810629)
 * You really shouldn’t alter core files like that, especially when there is a clean
   alternative. Try this:
 *     ```
       add_action('wp_enqueue_scripts', 'jkr_hide_bar', 99 );
       add_action('admin_enqueue_scripts', 'jkr_hide_bar', 99 );
       function jkr_hide_bar() {
          if( is_user_logged_in()) echo '<style type="text/css">
             #wpadminbar { display: none; }
             body { margin-top: -32px !important; }
          </style>';
       }
       ```
   
 * The code goes in functions.php of your theme, or preferably your child theme.
 *  Thread Starter [joker1234](https://wordpress.org/support/users/joker1234/)
 * (@joker1234)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/show_admin_barfalse-doesnt-work/#post-4810640)
 * Great, thanks!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘show_admin_bar(false); doesn't work’ is closed to new replies.

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 6 replies
 * 3 participants
 * Last reply from: [joker1234](https://wordpress.org/support/users/joker1234/)
 * Last activity: [12 years, 1 month ago](https://wordpress.org/support/topic/show_admin_barfalse-doesnt-work/#post-4810640)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
