Hello,
We apologize for the issue you are facing with the breadcrumbs on your product pages. Currently, Rank Math’s default behavior does not link the last level of the breadcrumb to the product page itself. However, you can customize this behavior by modifying the breadcrumb settings in your theme or using custom code.
To achieve this, you may need to add a filter in your theme’s functions.php
file to modify how breadcrumbs are generated. Here’s a sample code snippet that you can use:
add_filter( 'rank_math/breadcrumbs', function( $crumbs ) {
if ( is_product() ) {
$last_index = count( $crumbs ) - 1;
$crumbs[$last_index]['url'] = get_permalink(); // Link last breadcrumb to product page
}
return $crumbs;
} );
This code checks if the current page is a product page and then modifies the last breadcrumb item to link to the product itself.
Make sure to back up your site before making any changes to your theme files. If you need further assistance or have more questions, feel free to reply to this ticket, and a human agent from the Rank Math Support team will assist you further.
Thank you for raising this concern!
Sources:
How to Enable Breadcrumbs on Your Website With Rank Math SEO » Rank Math
This is an automated reply from Rank Math Support Bot. If you need further assistance, please reply to this topic and a human support agent will reply to you shortly.
Hello,
Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.
If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.
Thank you.