Back to Community

How to Customize WooCommerce Product Breadcrumbs in Breadcrumb NavXT

26 threads Sep 10, 2025 PluginBreadcrumb navxt

Content

Many WordPress users rely on the Breadcrumb NavXT plugin to create clear navigation paths for their visitors. However, when integrating with WooCommerce, users often encounter challenges in customizing the breadcrumb trail for their products. This guide covers the most common issues and their solutions, based on community discussions.

Common WooCommerce Breadcrumb Challenges

Users frequently want to modify the default breadcrumb structure generated by Breadcrumb NavXT for WooCommerce products. Common requests include:

  • Changing the hierarchy to reflect a custom page structure instead of the default shop/category archive.
  • Adding or removing specific categories or taxonomy terms from the trail.
  • Linking category breadcrumbs to specific pages rather than the default taxonomy archive.
  • Including product attributes or filter parameters in the breadcrumb trail.

Why This Happens

Breadcrumb NavXT is designed to generate location-based breadcrumb trails. This means it follows the inherent WordPress hierarchy of posts, pages, and taxonomies. By default, for WooCommerce products, this hierarchy is based on the 'shop' page and the 'product_cat' taxonomy. When users implement custom page structures, third-party filters, or complex product assignments, the plugin's default behavior may not align with the desired front-end navigation.

Most Common Solutions

1. Linking to a Page Instead of a Category Archive

If you want a category breadcrumb to link to a specific page instead of the WooCommerce category archive, you can use the bcn_breadcrumb_url filter. The Breadcrumb NavXT team provides a guide on their website for this. The essential code adaptation for WooCommerce is:

function my_breadcrumb_url_filter($url, $type, $id)
{
    // Change 'product_cat' to your taxonomy and MYCATID to your term ID
    if ($type === 'product_cat' && $id === MYCATID)
    {
        // Change PAGEID to the ID of your desired page
        $url = get_permalink(PAGEID);
    }
    return $url;
}
add_filter('bcn_breadcrumb_url', 'my_breadcrumb_url_filter', 10, 3);

2. Removing a Specific Category from the Trail

To exclude a certain WooCommerce product category from appearing in the breadcrumb trail, you can use a filter. Community members have successfully used code similar to what is discussed in this support thread. This typically involves hooking into the bcn_after_fill action to loop through the breadcrumb array and unset the specific item you want to remove.

3. Setting a Custom Hierarchy (Post Parent)

For those not using the default WooCommerce shop and category archives, you can define a custom hierarchy using the 'Post Parent' setting. In the Breadcrumb NavXT settings page, navigate to the 'Post Types' tab. For the 'Product' post type, change the 'Hierarchy' setting to 'Post Parent'. You will then need to set the appropriate parent page for each product in the WordPress page editor. This will create a trail like: Home > Parent Page > Product Name.

4. Adding Custom Items to the Trail (e.g., Attribute Filters)

Breadcrumb NavXT cannot automatically detect non-WordPress-core elements like attribute filter parameters (?filter_merk=Bk). To add these, you must manually add a breadcrumb to the trail using the bcn_after_fill action. The Breadcrumb NavXT website provides a guide on adding a static breadcrumb, which can be adapted to dynamically pull in attribute information.

Important Considerations

  • Testing: Always add custom code to a child theme's functions.php file or a custom site-specific plugin, and test on a staging site first.
  • Plugin Conflicts: If you are using other plugins that affect breadcrumbs or WooCommerce queries (e.g., product filters), ensure there are no conflicts causing unexpected behavior.
  • Theme Implementation: Simply activating Breadcrumb NavXT does not display breadcrumbs. You must ensure your theme calls the breadcrumb function (e.g., bcn_display()) in the appropriate template files.

By understanding the plugin's default behavior and utilizing WordPress filters, you can effectively tailor your WooCommerce breadcrumbs to fit your site's unique structure and improve user navigation.

Related Support Threads Support