Disable Admin Bar
Plugin doesn't fully disable Admin Bar (4 posts)

  1. Brian Zoetewey
    Posted 5 years ago #

    I noticed that just removing the 'wp_admin_bar_init' action doesn't fully disable the admin bar. In admin-header.php, the class 'admin-bar' still gets added to the the body tag which results in a 28px padding getting added to the top of the body.

    A more effective way to remove the admin bar would be:
    add_filter('show_admin_bar', '__return_false');

    Hope that helps.


  2. Bill Dennen
    Posted 5 years ago #

    thanks for posting this!

  3. DJTwittr
    Posted 5 years ago #

    Thank you for this... this works again... the remove wp-admin-bar-init code within the functions.php worked until the latest nightly.... this was a great find thanks for this. Go figure, i searched and searched on how to get this...now I don't want it lol.

  4. soblonde
    Posted 4 years ago #

    I have found this combination works great in version 3.2.1 popped in functions.php. Since tweaking it I now have faster load timesi in both the front and back end of my blogs.

    // Disable the Admin Bar
    add_filter( 'show_admin_bar', '__return_false' );
    // Remove the Admin Bar preference in user profile */
    add_action( 'admin_print_scripts-profile.php', 'hide_admin_bar_prefs' );
    function hide_admin_bar_prefs() { ?>
    <style type="text/css">
    	.show-admin-bar { display: none; }

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Disable Admin Bar
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic