Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
WooCommerce - remove breadcrumbs
add_action( 'init', 'jk_remove_wc_breadcrumbs' );
function jk_remove_wc_breadcrumbs() {
remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0 );
}
@davemac

This comment has been minimized.

Show comment Hide comment
@davemac

davemac Oct 17, 2016

If you want to add conditionals to this, such as only removing the breadcrumb on a single product page, then adding the hook to the 'template_redirect' actions instead works.

davemac commented Oct 17, 2016

If you want to add conditionals to this, such as only removing the breadcrumb on a single product page, then adding the hook to the 'template_redirect' actions instead works.

@corsonr

This comment has been minimized.

Show comment Hide comment
@corsonr

corsonr Apr 5, 2017

for WC 3.+ use:

remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20 );

corsonr commented Apr 5, 2017

for WC 3.+ use:

remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20 );
@crabilld

This comment has been minimized.

Show comment Hide comment
@crabilld

crabilld Apr 6, 2017

For some reason, the only thing that worked for me on WC 3.0 is:

add_filter( 'woocommerce_get_breadcrumb', '__return_false' );

I'm using Storefront with a custom child theme.

crabilld commented Apr 6, 2017

For some reason, the only thing that worked for me on WC 3.0 is:

add_filter( 'woocommerce_get_breadcrumb', '__return_false' );

I'm using Storefront with a custom child theme.

@crabilld

This comment has been minimized.

Show comment Hide comment
@crabilld

crabilld Apr 7, 2017

Nevermind, that now throws an error as of WC 3.0.1 (because WC is now trying to loop through a foreach without first checking whether any breadcrumbs exist). I haven't yet found a way to remove breadcrumbs, though I've tried everything that's been suggested online. Might be my problem, or might be a change in WC 3.0 + Storefront.

crabilld commented Apr 7, 2017

Nevermind, that now throws an error as of WC 3.0.1 (because WC is now trying to loop through a foreach without first checking whether any breadcrumbs exist). I haven't yet found a way to remove breadcrumbs, though I've tried everything that's been suggested online. Might be my problem, or might be a change in WC 3.0 + Storefront.

@stevehooker

This comment has been minimized.

Show comment Hide comment
@stevehooker

stevehooker Apr 11, 2017

I'm here with the same woes as crabilld. WooCommerce 3.0.1 and Storefront child. I've reverted back to the original Storefront functions.php due to upgrading to php 7.0 and now cannot hide Woo's breadcrumbs (unless I use css display none, which isn't the way I want).

crabilld's fix also fails for me in woo 3.0.1

I'm here with the same woes as crabilld. WooCommerce 3.0.1 and Storefront child. I've reverted back to the original Storefront functions.php due to upgrading to php 7.0 and now cannot hide Woo's breadcrumbs (unless I use css display none, which isn't the way I want).

crabilld's fix also fails for me in woo 3.0.1

@samunderwood

This comment has been minimized.

Show comment Hide comment
@samunderwood

samunderwood Apr 11, 2017

Anyone have any idea how to remove them? Struggling to figure it out, I'd rather not just hide it with CSS.

Anyone have any idea how to remove them? Struggling to figure it out, I'd rather not just hide it with CSS.

@mark-job

This comment has been minimized.

Show comment Hide comment
@mark-job

mark-job Jul 19, 2017

yes! i try to add this code to my functions.php,but it don't achieved, so i go to add dispaly:none to style.css that come true fastly

yes! i try to add this code to my functions.php,but it don't achieved, so i go to add dispaly:none to style.css that come true fastly

@ssuess

This comment has been minimized.

Show comment Hide comment
@ssuess

ssuess Jul 28, 2017

+1 to find a solution to this please. using the add_filter( 'woocommerce_get_breadcrumb', '__return_false' ); throws errors in other parts of woo unfortunately.

ssuess commented Jul 28, 2017

+1 to find a solution to this please. using the add_filter( 'woocommerce_get_breadcrumb', '__return_false' ); throws errors in other parts of woo unfortunately.

@Jamonzito

This comment has been minimized.

Show comment Hide comment
@Jamonzito

Jamonzito May 10, 2018

Any solution ?

Any solution ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment