If you want a cleaner WooCommerce product page, you can remove the default breadcrumb navigation from your product pages with a simple action hook.
Steps
- Open your theme’s
functions.phpfile. - Add the code below.
- Save the file.
- Refresh your WooCommerce product page.
Done — the WooCommerce breadcrumbs will no longer appear on product pages.
function remove_product_breadcrumbs() {
if ( is_product() ) {
remove_action(
'woocommerce_before_main_content',
'woocommerce_breadcrumb',
20
);
}
}
add_action(
'wp',
'remove_product_breadcrumbs'
);