WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. Brian Zoetewey
    Member
    Posted 3 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.

    http://wordpress.org/extend/plugins/disable-admin-bar/

  2. Bill Dennen
    Member
    Posted 3 years ago #

    thanks for posting this!

  3. DJTwittr
    Member
    Posted 3 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
    Member
    Posted 2 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' );
    wp_deregister_script('admin-bar');
    wp_deregister_style('admin-bar');
    remove_action('wp_footer','wp_admin_bar_render',1000);
    
    // 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; }
    </style>
    <?php
    }

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic