Woocommerce Breadcrumb Bug

  • Hello.

    I am having an issue with breadcrumbs on Woocommerce product pages. It appears to be a bug.

    I have an installation with Woocommerce and a blog. I have not yet tested the blog, but there is an issue with permalinks on the product pages.

    Each product has a few categories assigned to it. I have set a primary category for each product, however it ignores the primary and uses the first selected category from the list on the product edit page (admin side).

    For example the breadcrumb should look like this:

    Home » Shop » Primary Category » Product Page Title

    But instead looks like this:

    Home » Shop » First Selected Category » Product Page Title

    I am using Rank Math and have also enabled the following setting:

    WP Admin->Rank Math-> General Settings-> Woocommerce-> Remove category base [ON]

    Thank you.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hello,

    When you have more than 1 category selected, please choose the one you want to show in the breadcrumbs as “Make term primary”
    make primary

    Make sure Primary Category is also select from the drop-down in WordPress Dashboard > Rank Math > Titles & Meta > Products > Product Taxonomy.

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Hi @uzair-na

    As stated in my original message I have already done the “Make term primary” part which you have shown in your screenshots. But thanks for confirming that I am doing the right thing.

    As for your second instruction to check the setting for WordPress Dashboard > Rank Math > Titles & Meta > Products > Product Taxonomy

    Mine is currently set to [Product Categories]. There is NO option for “Primary Category”.

    The options to choose from are as follows:
    Product Categories
    Product Tags

    Therefore I am confident that I have everything set up correctly, and so can only deduce that this is a bug in Rank Math.

    Please can you get someone to look into this as it is a big issue I think.

    Thank you for you help thus far.

    If that doesn’t work, we might need to take a closer look at the settings. Please edit the first post on this ticket and include your WP logins in the designated Sensitive Data section.

    asking for logins

    It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:

    Temporary Login Without Password

    You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):

    WP Security Audit Log

    We really look forward to helping you.

    Hi Jim,

    I wanted to let you know that we have identified it as a bug and an update with a fix will be provided soon.

    For now, please use this code in your theme’s functions.php file to fix the issue:

    add_filter( 'rank_math/frontend/breadcrumb/main_term', function( $current_term, $terms ) {
        if ( function_exists( 'is_product' ) && is_product() ) {
            global $post;
            $terms = get_the_terms( $post, 'product_cat' );
            if ( ! empty( $terms ) ) {
                return $terms[0];
        return $current_term;
    }, 10, 2 );

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Hi @uzair-na

    Thanks for recognising this as a bug and glad to hear it will be fixed soon :-). I am currently building the site on localhost, and I am assuming by soon you mean within a few days / a week or 2? If that is the case I will leave the temporary code as it should be fixed just before the site goes live.

    @info670 here is a solution to your breadcrumb issue. I read your support request while looking for a solution to the same problem and see your thread is still unresolved, but the answer is here.

    Thank you.


    The issue will be fixed in the next week positively.

    Appreciate your patience in this matter.

Viewing 6 replies - 1 through 6 (of 6 total)

The ticket ‘Woocommerce Breadcrumb Bug’ is closed to new replies.