woocommerce_get_breadcrumb can now hand you null in 10.6

WooCommerce 10.6 changes the woocommerce_get_breadcrumb filter in a way that is easy to miss and expensive to hit. Anyone who has worked with WooCommerce for a while knows that a minor advisory can turn into a long night of debugging when a client site goes dark after an update. The integration with the WordPress Core Breadcrumbs block means your filter callback can now receive a null value where it used to get an object.

Gutenberg meets WooCommerce

The woocommerce_get_breadcrumb filter used to apply only to WooCommerce’s own Store Breadcrumb block. After Gutenberg PR #74169, WooCommerce hooks into the WordPress Core Breadcrumbs block through the block_core_breadcrumbs_items filter. Good for consistency across the site, but it changes the context your callback runs in.

The second parameter ($breadcrumb) was previously guaranteed to be a WC_Breadcrumb instance. In WooCommerce 10.6, when the Core Breadcrumbs block triggers the filter, that parameter is null.

Is your woocommerce_get_breadcrumb implementation safe?

If you use the core/breadcrumbs block and have custom logic hooked into this filter, audit it now. Calling a method on a null object throws a fatal error, the same way WooCommerce 10.5.1 broke “Add to Cart” buttons for some sites after an unexpected change.

The version below is the one that will break:

add_filter( 'woocommerce_get_breadcrumb', function( $crumbs, $breadcrumb ) {
    // ❌ Fatal Error: Calling a method on null when using Core Breadcrumbs
    $breadcrumb->add_crumb( 'Promo', '/sale/' );

    return $crumbs;
}, 10, 2 );

Refactoring for WooCommerce 10.6

The fix is to confirm the object exists before you touch it. An instanceof check is the cleanest way to know you really have a WC_Breadcrumb instance, and it is the same defensive shape the removal of accessible private methods in 10.5 called for.

The safe version:

add_filter( 'woocommerce_get_breadcrumb', function( $crumbs, $breadcrumb ) {
    // ✅ Safe: Check the object type before using methods
    if ( $breadcrumb instanceof WC_Breadcrumb ) {
        $breadcrumb->add_crumb( 'Custom Crumb', '/custom-url/' );
    }

    return $crumbs;
}, 10, 2 );

If all you need is to modify the $crumbs array, skip the second parameter entirely. Array-based modification stays safe whether the filter fires from a Core block or a WooCommerce one.

If woocommerce_get_breadcrumb work is eating your dev hours, I can take it on. I have been wrestling with WordPress since the 4.x days.

Check your types before 10.6 lands

The change is scheduled for March 10, 2026 as part of WooCommerce 10.6, and you can follow it in WooCommerce PR #62770. Do not assume a filter parameter is still an object just because it always has been. Check the type, refactor before the release, and the routine update stays routine.

author avatar
Ahmad Wael
I'm a WordPress and WooCommerce developer with 15+ years of experience building custom e-commerce solutions and plugins. I specialize in PHP development, following WordPress coding standards to deliver clean, maintainable code. Currently, I'm exploring AI and e-commerce by building multi-agent systems and SaaS products that integrate technologies like Google Gemini API with WordPress platforms, approaching every project with a commitment to performance, security, and exceptional user experience.