Title: Admin bar not hiding
Last modified: February 13, 2017

---

# Admin bar not hiding

 *  Resolved [Unclouded Studio](https://wordpress.org/support/users/uncloudedstudio/)
 * (@uncloudedstudio)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/admin-bar-not-hiding/)
 * Hi,
 * I’m trying to hide the admin bar for all users except “administrator”.
 * No matter what plugin or snippet I use the admin bar is always present for non-
   admin users, even when I uncheck it manually in the users profile, no
    affect
   whatsoever.
 * If I deactivate for all users using the snippet below it only deactivates the
   administrator, really strange!
 *     ```
       /* Disable WordPress Admin Bar for all users but admins. */
         show_admin_bar(false);
       ```
   
 * Who is experiencing the same problems and who has a solution?
 * Thanks,
 * Diederik

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

 *  [Davood Denavi](https://wordpress.org/support/users/binarywc/)
 * (@binarywc)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/admin-bar-not-hiding/#post-8797557)
 * Try using this code instead!
 *     ```
       function remove_admin_bar() {
       if (!current_user_can('administrator') && !is_admin()) {
         show_admin_bar(false);
       }
       }
       ```
   
 *  Thread Starter [Unclouded Studio](https://wordpress.org/support/users/uncloudedstudio/)
 * (@uncloudedstudio)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/admin-bar-not-hiding/#post-8799589)
 * Hi Davood,
 * Thank you for your reply.
 * Already tried that but it doesn’t work.
 * Unchecking it manually via “Users> your profile > uncheck Show Toolbar when viewing
   site” has to work without the use of plugins or code snippits but it doesn’t.
 * I’ve migrated the site from another domain where I also experienced the same 
   problem and reinstalled WordPress in the hope it would fix the problem, no luck.
 * -Reinstalled WordPress
    -Switched themes -Deactivated plugins and activated one
   by one
 * Maybe has something to do with the database?
 *  [Davood Denavi](https://wordpress.org/support/users/binarywc/)
 * (@binarywc)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/admin-bar-not-hiding/#post-8799660)
 * I do not think it has anything to do with the database. Are you sure you are 
   adding the code to the themes functions.php file? If so, then please tell me 
   what themes you are using the code with because I suspect it would be an issue
   with the theme not supporting this code and you may need to contact their support
   for help with this.
 *  Thread Starter [Unclouded Studio](https://wordpress.org/support/users/uncloudedstudio/)
 * (@uncloudedstudio)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/admin-bar-not-hiding/#post-8799915)
 * Yes, i’m adding the code to the functions.php in my child theme and also tried
   adding it to the parent themes functions.php.
 * I also thought it had something to do with the theme but it happens with every
   theme I use.
 * The weird thing is that with some plugins or codes the admin for administrator
   does hide but for the other user roles the admin bar remains present.
 *  [Davood Denavi](https://wordpress.org/support/users/binarywc/)
 * (@binarywc)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/admin-bar-not-hiding/#post-8799931)
 * Then there is a plugin conflict. It is either a plugin conflict or a theme conflict…
   if you say it happens with every theme you use including out of the box ones 
   like Twenty Sixteen then it is a plugin conflict.
 *  Thread Starter [Unclouded Studio](https://wordpress.org/support/users/uncloudedstudio/)
 * (@uncloudedstudio)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/admin-bar-not-hiding/#post-8800538)
 * I’ve found the problem!
 * I’ve deactivated the Maintenance plugin from fruitfulcode and everything is behaving
   like it should.
 * Thanks for the help.
 *  [Davood Denavi](https://wordpress.org/support/users/binarywc/)
 * (@binarywc)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/admin-bar-not-hiding/#post-8800559)
 * Glad you found the culprit.
 * We are here to help any time. Feel free to post here anytime!

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

The topic ‘Admin bar not hiding’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 7 replies
 * 2 participants
 * Last reply from: [Davood Denavi](https://wordpress.org/support/users/binarywc/)
 * Last activity: [9 years, 2 months ago](https://wordpress.org/support/topic/admin-bar-not-hiding/#post-8800559)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
