Hello,
Thank you for contacting Rank Math for help with your product category URLs and breadcrumbs.
Please check your product category settings. To do that, go to your WordPress dashboard > Settings > Permalinks. Delete what is entered in the “Product Category Base” field to reset it to the default and click “Save Changes” at the bottom of the page. Next, check if the product category URL is working.
If the above does not work, please share your website URL in the designated sensitive data area so we can check the URLs and breadcrumbs to better understand the issue.
Hope that helps. Please let us know if you have questions.
Hello,
I have updated the sensitive data as requested. Can you please check further?
Thank you.
I can not see the same settings that you have with for example “product category base”.
Do we need pro verision?
Hello,
Sorry for the confusion I caused. The instructions I gave earlier were for WooCommerce products. Please follow the instructions below to fix your custom post type breadcrumbs.
Please use the filter below to change taxonomy name in breadcrumbs:
add_filter( 'rank_math/frontend/breadcrumb/items', function( $crumbs, $class ) {
$post_type = get_post_type(get_queried_object());
if ($post_type == 'product') {
$crumbs[1][0] = 'Products';
$crumbs[1][1] = 'http://yourCPTURL'; // Change this to match the correct URL
$crumbs[2][0] = get_the_title();
}
return $crumbs;
}, 10, 2);
Hope that helps. Please let us know if you have questions.
Hi
Thanks for your reply.
This worked only for the single template.
The problem is still there on the taxonomy page.
That it says the taxonomy name instead of archive title and a link.
I did test to write “Produktersss” and you can se in my example. But if you jump back to taxonomy. You will se “Produktkategori”.
Sensitive updated.
Hello,
The code snippet I provided works for single product pages. For category archives you will need to adjust the code:
add_filter( 'rank_math/frontend/breadcrumb/items', function( $crumbs, $class ) {
$post_type = get_post_type(get_queried_object());
if ($post_type == 'product'|| is_tax('productcategory')) {
$crumbs[1][0] = 'Products';
$crumbs[1][1] = 'http://yourCPTURL'; // Change this to match the correct URL
$crumbs[2][0] = get_the_title();
}
return $crumbs;
}, 10, 2);
In the code snippet, replace ‘productcategory’ with your taxonomy name.
Hope that helps. Please let us know if you have questions.
Hi
Thanks for your reply.
This did worked out now when changed this code and only used “tax” and change number on the title.
add_filter( 'rank_math/frontend/breadcrumb/items', function( $crumbs, $class ) {
$post_type = get_post_type(get_queried_object());
if (is_tax('productcategory')) {
$crumbs[1][0] = 'Products';
$crumbs[1][1] = 'http://yourCPTURL'; // Change this to match the correct URL
$crumbs[2][1] = get_the_title();
}
return $crumbs;
}, 10, 2);
So then we need to add this for every CPT:s we will have.
Is this a bug?
Or is this something you will add to your main code so this will work by default?
We did use Yoast before we did go over to just run your plugin. And I know it is a default rule in Yoast, so we dont need to add an extra code for every CPT:s.
Best regards
Anders
Hello,
Showing the post type taxonomy name is the default setting for Rank Math. To change it you will have to add a code snippet like the one above, depending on how you name your post type and taxonomy.
Hope that answers you. Please let us know if you have other questions.
Hi
Okey, perfect thanks for your help 🙂
/Anders
Hello,
We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.
If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.
If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.
Thank you.