Hello,
Thank you for contacting Rank Math support today and bringing your concern to our attention.
Can you please confirm if you have selected a static page for the “Post page” option in WordPress settings?
If you are not using a static page for your “Post page” and you still wish to add “blog” to your breadcrumbs, you may need to customize it using our filter: https://rankmath.com/kb/filters-hooks-api-developer/#breadcrumbs
Looking forward to helping you with this one.
Yes, we have Static Page selected. We have a homepage selected, but no Posts page selected, as described under the heading Custom Posts Page on this page: https://wordpress.com/support/posts-page/
Hello,
You can use and customize the following filter to add the “Blog” in the breadcrumbs:
add_filter( 'rank_math/frontend/breadcrumb/items', function( $crumbs, $class ) {
$blog = ['Blog',
'https://rankmath.com' //replace with the URL of the page
];
array_splice( $crumbs, 1, 0, array($blog) );
return $crumbs;
}, 10, 2);
And here is how to add a filter to your site: https://rankmath.com/kb/wordpress-hooks-actions-filters/
Hope that helps.
Thank you.
Thank you for this code. I’ve added it and wanted to a request a modification–is it possible to put the “Blog” entry at the beginning of the string? Right now it’s appearing on the right, and in the case of a category & sub-category showing, it appears between them: SEO | Blog | Local SEO. See: https://twooctobers.com/blog/yes-moz-local-works/
I appreciate your assistance.
Hello,
To show breadcrumbs in order like Blog | SEO | Local SEO, please try replacing the above code with the following one:
add_filter( 'rank_math/frontend/breadcrumb/items', function( $crumbs, $class ) {
$blog = ['Blog',
'https://twooctobers.com/blog/' //replace with the URL of the page
];
array_splice( $crumbs, 0, 0, array($blog) );
return $crumbs;
}, 10, 2);
Let us know how it goes. Looking forward to helping you.
Thank you.
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.