I know we can manually edit the breadcrumb title for a page or post using Yoast SEO’s breadcrumb functionality.
But with thousands of posts and pages on an existing site this isn’t desirable.
My brain goes full potato when it comes to stuff other than html and css and maybe hacking some existing PHP code snippets to do my bidding with a lot of trial and error. So that’s why I’m reaching out to the community here.
Example:
A child page about blue widgets lives at:
https://www.example.com/widgets/blue
By default I believe the automatically generated breadcrumb path for this child page of a parent page would look something like:
Home > We make the most amazing widgets in the world > Our Blue widgets are everything you need!
The filter would instead:
- Use the url slug for each page [widgets] and [blue] as the breadcrumb title.
- Capitalize the first letter of only the first word.
- Turn any dashes (-) in the slug into spaces for the breadcrumb title.
And output a breadcrumb that looks like this:
Home > Widgets > Blue
The filter would target pages, posts and categories across the board so that all webpages on the site would have a breadcrumb with breadcrumb titles based on the url slugs of the different parts of the breadcrumb path.
If it is possible to still manually override the filter by entering a custom breadcrumb title in the existing Yoast SEO custom breadcrumb title field, that would be awesome.
I have tried to find existing code snippets that come close to this functionality but haven’t been succesful so far.
Any help or links you are willing to provide will be appreciated very much. Thank you in advance for taking the time to reply.