Skip to content

Instantly share code, notes, and snippets.

@woogists
Last active December 6, 2021 13:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save woogists/9b1667ed8c08b51ca3fe76e751cd2348 to your computer and use it in GitHub Desktop.
Save woogists/9b1667ed8c08b51ca3fe76e751cd2348 to your computer and use it in GitHub Desktop.
[Frontend Snippets][Customize the WooCommerce breadcrumb] Remove the breadcrumbs
/**
* Remove the breadcrumbs
*/
add_action( 'init', 'woo_remove_wc_breadcrumbs' );
function woo_remove_wc_breadcrumbs() {
remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0 );
}
@olafmol
Copy link

olafmol commented Jul 6, 2020

This functionality doesn't work anymore in the latest Woocommerce (4.2.2)

@Lisherex
Copy link

I have the same issue. Anyone knows how to handle it ?

@lunule
Copy link

lunule commented Dec 6, 2021

@Siddal Just use the traditional/standard way to remove the action - use the original hook woocommerce_before_main_content instead of init.

// Remove the breadcrumbs
function woo_remove_wc_breadcrumbs() {
    remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0 );	
}
add_action( 'woocommerce_before_main_content', 'woo_remove_wc_breadcrumbs', 1 );

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