• Greetings,

    I own a WordPress site and I am having an annoying issue. There’s a bar at the top which is normally the admin bar, but when you’re logged out there’s a button to log in.

    In other words, I would like to remove the bar for guests.

    Any help would be appreciated.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello,

    There might be couple of ways to do this with the admin dashboard or through a code snippet.

    1) How about going to the admin dashboard –> users –> and uncheck “Show Toolbar when viewing site”

    2) Paste this into your functions.php of your child theme or a plugin

    add_filter( ‘show_admin_bar’, ‘__return_false’ );

    3) Paste this into your functions.php of your child theme or a plugin

    function remove_admin_bar()
    {
    if (!current_user_can(‘administrator’) && !is_admin()) {
    show_admin_bar(false);} }`

    `add_action(‘after_setup_theme’, ‘remove_admin_bar’);

    Thread Starter worfetc

    (@worfetc)

    Hi,

    This is showing for guests, not a user. Because of this I cannot remove the toolbar for them.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Admin bar showing ‘Log in’ when logged out’ is closed to new replies.