Hello,
Thanks for contacting us, and sorry for any inconvenience that might have been caused due to that.
Please make sure you’ve chosen None as Primary Taxonomy at Rank Math > Titles & Meta > Posts [OR any other post type you want to apply the settings].
https://rankmath.com/kb/titles-and-meta/#primary-taxonomy
Let us know how it goes. Looking forward to helping you.
Thank you.
Hello Sakib,
It works. Thank you very much.
However I’m curious how I could remove it via a code snippet, leaving the category option enabled.
Is it possible to know?
Thanks in advance
Hello,
Yes, that’s possible. You can try adding the following filter to remove categories from your breadcrumbs:
add_filter('rank_math/frontend/breadcrumb/items', function ($crumbs, $class) {
$categories = array_map( function ( $category ) {
return $category->name;
}, get_the_category() );
foreach($categories as $category){
$key = array_search($category, array_column($crumbs, '0'), true);
if (isset($key)) {
unset($crumbs[$key]);
$crumbs = array_values($crumbs);
}
}
return $crumbs;
}, 10, 2);
Here’s how you can add filters/hooks to your WordPress site:
https://rankmath.com/kb/wordpress-hooks-actions-filters/
Let us know how it goes. Looking forward to helping you.
Thank you.
Hi Sakib!
It works properly.
Thank you very much for your work and for helping people with less knowledge in programming.
Keep up the good work
Hello,
Glad that helped.
Please feel free to reach out to us again in case you need any other assistance.
We are here to help.
Thank you.