wordpress - woocomerce - remove breadcrumbs from shop landing page


Staff member
I have wordpress with woocommerce. I am trying to stop the breadcrumbs displaying on the page that lists the categories which I have set as the 'shop page' in the wc settings.

The id of the page is '5' and it has the name/slug 'materials'

in my functions.php I have put

if (is_page('materials')){
    add_action( 'init', 'am_remove_wc_breadcrumbs' );
function am_remove_wc_breadcrumbs() {
    remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0 );

i have changed the selector in the if statement to 5 - no joy either. If I remove the if statement around the add_action then the breadcrumbs are removed from all the pages - as you'd expect.