Woocommerce: remove ‘visit site’ or ‘visit store’

Woocommerce adds ‘visit store’ in the admin bar in WordPress whenever I activate it. This has the consequence that I have both a ‘visit site’ and a ‘visit store’ there.

However, I don’t really see what the benefit is of this (please tell me if there is any) – so I want to get rid of either that or the ‘visit site’ link. How can I do that?

Read More

(My question is very similar to that of the poster here but I don’t have access to that forum – maybe someone else does? http://www.kadencethemes.com/support-forums/topic/woocommerce-remove-visit-store/)

Related posts

2 comments

  1. Please use this.

    function remove_admin_bar_links() {
        global $wp_admin_bar;
        $wp_admin_bar->remove_menu('view-site');        // Remove the view site link
        $wp_admin_bar->remove_menu('site-name');        // Remove the site name menu
    }
    add_action( 'wp_before_admin_bar_render', 'remove_admin_bar_links' );
    
  2. function remove_admin_bar_links() {
        global $wp_admin_bar;
        $wp_admin_bar->remove_menu('view-site');  // Remove the view site link
        $wp_admin_bar->remove_menu('view-store'); // Remove the view store link
        $wp_admin_bar->remove_menu('site-name');  // Remove the site name menu
    }    
    add_action( 'wp_before_admin_bar_render', 'remove_admin_bar_links' );
    

Comments are closed.