X

Remove WooCommerce breadcrumbs on specific pages

If you need to remove the breadcrumbs from within WooCommerce, but only on a specific page or set of pages, add the following snippet to the functions.php file of your WordPress theme. This snippet will remove breadcrumbs from the shop page only by using the is_shop() function.

add_action('template_redirect', 'remove_shop_breadcrumbs' );
function remove_shop_breadcrumbs(){

	if (is_shop())
		remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0);

}

There are several functions you can use to remove breadcrumbs from specific pages in WooCommerce. Here are a few examples:


if(is_shop()){ ... } // shop page

if(is_front_page() ){ ... } // static front page

if(is_home()){ ... } // default page

Comments  Leave a Reply

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WordPress Launch Checklist

The Ultimate WordPress Launch Checklist

We've compiled all the essential checklist items for your next WordPress website launch into one handy ebook.
Yes, Send Me the Free eBook!