Title: Disable the admin bar. Plugin Vs code in functions.php
Last modified: August 31, 2016

---

# Disable the admin bar. Plugin Vs code in functions.php

 *  [bogski](https://wordpress.org/support/users/bogski/)
 * (@bogski)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/disable-the-admin-bar-plugin-vs-code-in-functionsphp/)
 * Hello!
 * I’ve just installed a WordPress website on my local machine to have a play around
   with new WordPress RC. I found a piece of code to hide the the admin bar in the
   header of the website which works cool.
 * This is the code `/*Disable WordPress Toolbar from header*/
    add_filter(‘show_admin_bar’,‘
   __return_false’);`
 * I have pasted this directly into the functions.php of my child theme and it works
   great.
 * Whilst searching for that code i noticed there were a few plugins to do the same
   thing. Now i’ve been looking into writing a plugin for word press and thought
   this might be a simple one to start with.
 * The question is though, is there any real difference in using this code like 
   that or putting it in a plugin? does it make any difference to security or anything
   like that?
 * Edit: I should mention i wasnt able to select the version im using from the drop
   down. I am using the latest RC for WP 4.5
 * Many thanks
 * Bogski

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

 *  [doubleedesign](https://wordpress.org/support/users/doubleedesign/)
 * (@doubleedesign)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/disable-the-admin-bar-plugin-vs-code-in-functionsphp/#post-7257658)
 * > does it make any difference to security or anything like that?
 * I don’t think so, no.
 * >  is there any real difference in using this code like that or putting it in
   > a plugin?
 * It really depends on your need. If you never want it there and are unlikely to
   change your theme, then in the theme is fine. If you want to be able to switch
   it on and off and persist if you change themes, then plugin is the way to go.
 *  Thread Starter [bogski](https://wordpress.org/support/users/bogski/)
 * (@bogski)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/disable-the-admin-bar-plugin-vs-code-in-functionsphp/#post-7257664)
 * Thanks, that will do for me. I think i’ll try writing a plugin to see how it 
   works.
 * Thanks doubleedesign
 * Bogski

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

The topic ‘Disable the admin bar. Plugin Vs code in functions.php’ is closed to 
new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [bogski](https://wordpress.org/support/users/bogski/)
 * Last activity: [10 years, 1 month ago](https://wordpress.org/support/topic/disable-the-admin-bar-plugin-vs-code-in-functionsphp/#post-7257664)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
