Hello,
Thank you for contacting us.
You can modify and use this filter to achieve that:
https://rankmath.com/kb/filters-hooks-api-developer/#change-remove-breadcrumb-items
Hope this helps.
Thank you.
Hi Prabhat thanks for the reply, are you able to please give me a basic example or a reference I can refer to for this.
/**
* Allow changing or removing the Breadcrumb items
*
* @param array $crumbs The crumbs array.
* @param Breadcrumbs $this Current breadcrumb object.
*/
add_filter( ‘rank_math/frontend/breadcrumb/items’, function( $crumbs, $class ) {
return $crumbs;
}, 10, 2);
Other users are reporting the same thing just need a example bit of code to reference, would just like some basic help or an example to ref to etc.
https://generatepress.com/forums/topic/breadcrumb-link-problem/
All I want to do is change the breadcrumb link from
http://mysite/category/news/
to
http://mysite/news/
Any help would be great
Hello,
Please refer to my example filter here to change the breadcrumb’s item URL:
add_filter( 'rank_math/frontend/breadcrumb/items', function( $crumbs, $class ) {
$crumbs[1][1] = "theURL";
return $crumbs;
}, 10, 2);
The order of the breadcrumbs is determined by the index in the $crumbs array.
Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.
Hi Jermey thanks so much for reaching out. Still not something I am understanding here, sorry think this is the first time I’ve ever tried to apply a filter in WP.
Ok I try the code below, a white screen initially flashes up with this code at the top then it disappears and shows the full page, is that how this should behave or?
add_filter( ‘rank_math/frontend/breadcrumb/items’, function( $crumbs, $class ) {
$crumbs[1][1] = “/news/”;
return $crumbs;
}, 10, 2);
However once the page fully renders I don’t seem to be able to impact the breadcrumbs at all, I have tried [1][2], [2][1], [2][2] etc
The breadcrumb I am trying to change is listed at
Home > news (so I presume that is [1][2] ????
Also I do not understand what the 10, 2 is referring to at the end of the function.
Any help would be great
Hello,
We might need to take a closer look at the settings. Please edit the first post on this ticket and include your WordPress logins in the designated Sensitive Data section.
Please do take a complete backup of your website before sharing the information with us.
![Sensitive Data Section](https://i.mythemeshop.com/SphEG0+)
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:
https://wordpress.org/plugins/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):
https://wordpress.org/plugins/wp-security-audit-log/
We really look forward to helping you.
Hello,
I have updated the sensitive data as requested. Can you please check further?
Thank you.
Hello,
I have added the modified code in your rank-math.php file:
add_filter( 'rank_math/frontend/breadcrumb/items', function( $crumbs, $class ) {
$crumbs[1][1] = 'http://103.18.109.95/~tfdtestcom/wordpresslatest/news/';
return $crumbs;
}, 10, 2);
And now your breadcrumb is showing the correct link.
Please check and let us know if you need any other assistance.
Thanks.
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.