WordPress.org

Forums

Remove admin_bar? (6 posts)

  1. Andrew
    Member
    Posted 3 years ago #

    Hello.

    Is there anyway to remove the admin bar completely? It's taking space on my page even though it's not showing.

    I guess it shows because of wp_head. is there anyway to prevent wp_head from adding it at all, instead of just hiding it?

    Please help.

    Thank you,

    Andrew

  2. w1nk5
    Member
    Posted 3 years ago #

    You can remove the admin bar via your profile settings in the backend or you can add the following code to your functions.php.

    /*
     * Remove the admin bar and admin bar settings
     */
    add_action( 'init', 'disable_admin_bar' , 9 );
    function disable_admin_bar() {
    	// Hide Admin Bar
        add_filter( 'show_admin_bar', '__return_false' );
        add_action( 'admin_print_scripts-profile.php',
             'hide_admin_bar_settings' );
    }
  3. Andrew
    Member
    Posted 3 years ago #

    Okay, never mind. I seem to have figured it out. I had it set to show on the dashboard.. But it wasn't showing anyway? Just the space for it was apparent.

    Anyway, I got it hidden now.

    Thank you,

    Andrew

  4. Andrew
    Member
    Posted 3 years ago #

    Okay, thank you, w1nk5.

    Does this remove the code or hide it? Some people said that the code still takes up memory if you just hide it.

    Please help.

    Thank you,

    Andrew

  5. w1nk5
    Member
    Posted 3 years ago #

    The code above will stop the admin bar from loading when WordPress is initializing.

  6. Andrew
    Member
    Posted 3 years ago #

    Okay, thank you.

    :Dd

    -Andrew

Topic Closed

This topic has been closed to new replies.

About this Topic