[How to] Disable WordPress Admin Bar
WordPress 3.1 brings a new feature called wordpress admin bar. That’s a bar displayed on top of your site when you log in and it gives you quick access to general admin actions. I’m sure they will add an option to hide it soon. Until then, here is how to hide it manually.
1. Open functions.php
in your theme folder.
2. Put the following code anywhere you like. (Must be wrapped inside <?php
& ?>
tags)
[php title=”functions.php – Code to disable admin bar”]function disable_admin_bar(){
return false;
}
add_filter( ‘show_admin_bar’ , ‘disable_admin_bar’ );
If you don’t want to edit your files, there is also a plugin doing this job for you.
Like this post? Take a look at my other wordpress hacks:
- Enable Automatic Title Tags in Your Theme, Fix Duplicate Title Tags
- [How to] Change the Default WordPress Title Separator
- [How to] Change Default WordPress Title Separator
- Remove Billing Fields from Woocommerce Checkout
- Shortcode to Display Content Only on Mobile
- [How to] Redirect 404 Hits to Your Homepage in WordPress
- [How to] Find Which Page Template Is Used By WordPress
- Replace WordPress jQuery with CDN jQuery using wp_enqueue_script
- [How to] Change Number of Posts Displayed on Search Only
- [Hack] Add Browser CSS Classes to Body Using WP Filters
- [How to] Display Most Viewed Posts First on Search Results
- [How to] Make Auto-embedded Youtube Videos Obey z-index
- [How to] Exclude Categories and Tags From Widgets
- [How to] Display “Back to parent” Link on Pages
- [How to] Display Latest Tweet on WordPress
- [How to] Enable Comments for All Posts in WordPress Using PHP
- [How to] Use WordPress Shortcodes in Theme Using PHP
- [How to] Display Site Logo on Facebook if Post Doesn’t Have a Thumbnail
- How to Use “wp_enqueue_script” to Add Javascript to Theme
- [How to] Change WordPress Default Embed Size Using Filters
- How to Enable Shortcodes in Widgets for WordPress
- [How to] Disable WordPress Admin Bar
- [How to] Change HTML Editor Font in WordPress
- [How to] Change Dropdown Menu Depth and Order Using Filters
- [How to] Hide Members Only Content in WordPress
- Advanced Adsense Targeting in WordPress – Part 2
Deal Notice: We are using A2 hosting for all of our websites, and we are really happy with their service. So we wanted to share you this discount link for you to try it out. If you get a hosting using this link, you will also help us build better content for you: SSD Hosting - 300% Faster Than Standard Hard Drives