WordPress.org

Ready to get started?Download WordPress

Forums

How to remove Admin/User Bar on WordPress 3.1? (4 posts)

  1. ipunkbali
    Member
    Posted 3 years ago #

    I know how to remove the bar for my admin, its right in the setting, but I dont know how to remove the bar for my users or registered members?

    I have wp question answer forum with over 6000 users and they all can see the annoying bar. It took the ad space too.

    How to remove this? thanks

  2. Thorned Rose
    Member
    Posted 3 years ago #

    Try putting this in your theme's function.php:

    remove_action('init', 'wp_admin_bar_init');

    If you also want to remove the enable/disable option in user preferences, try this instead:

    <?php function hide_admin_bar_settings() {
    ?>
    <style type="text/css">
    	.show-admin-bar { display: none;}
    </style>
    <?php
    }
    
    function disable_admin_bar() {
        add_filter( 'show_admin_bar', '__return_false' );
        add_action( 'admin_print_scripts-profile.php', 'hide_admin_bar_settings' );
    }
    add_action( 'init', 'disable_admin_bar' , 9 );
    ?>
  3. ipunkbali
    Member
    Posted 3 years ago #

    thanks, but its not working.

    I logged on as a member, not ADMIN, and still see the bar. :(

  4. Thorned Rose
    Member
    Posted 3 years ago #

    Which version of the code above did you try?

Topic Closed

This topic has been closed to new replies.

About this Topic