How To Modify WP SEO Breadcrumbs For

How To Modify WP SEO Breadcrumbs For

A day ago, Ian Anderson Gray from opened this new thread in the Github repository for Yoast’s WordPress SEO plugin. He surely isn’t the only one thinking about using markup in WordPress (I do too!), so if you are also interested, you should join the discussion. In this article I will not tell you the great unique amazing solution for this. BUT – I will show you how to modify the WordPress SEO plugin (using filters only) so that the plugin’s breadcrumbs will be using valid markup instead of the old RDFa markup.

I personally think that should be handled by WordPress themes because it will pretty much integrate with everything on the website (it should so that Google gets as much information as possible!). So while a plugin for this might help, I’d prefer to see themes that fully feature markup. For this reason, I just developed a way to modify the breadcrumbs from Yoast’s WordPress SEO plugin. Adding the class below will do all the changes. I just wrote this, and I don’t have too much time right now, so I won’t describe everything in there. But if you are a coder, that should not be too hard to understand. So here is my class which will replace the RDFa markup with valid markup that is correctly parsed by Google.

You can find and download the current version of the class on Github.

All you need to do is include this class in your theme and then instantiate it. The readme file in the Github repository tells you how to do so.

And that’s it!

If you have any questions about the usage of this class or if you find any mistakes or bugs, please comment or email me, thank you in advance!

10 thoughts on “How To Modify WP SEO Breadcrumbs For

  1. Hi Felix,

    Why use when Yoast is telling us Google still prefers the old format:

    QUOTE: Google itself still states it prefers RDFa for breadcrumbs

    You didn’t reply on Yoast @Github when he told us that, but he also posted a link to support his statement. However, I read that document, but that\’s to technical for me at the moment and I couldn’t find anything what was telling us not to use However, I would like your opinion about it.



    1. Hello Willem,

      To be honest, I was a little busy in recent weeks, sorry…

      I also had some problems to understand everything in that mail, but like you, I didn\’t see a point where they were telling not to use I just answered at Github, so maybe Yoast will explain this to me.

      My personal opinion is this, I think using all over would just be coherent. Google recommends using it, so why not use it for breadcrumbs aswell? It certainly works (if you do it right) like I tested… But maybe let\’s wait for Yoast\’s answer on that.

      Thanks for your comment, I hope this gets solved soon!


      1. Hi Felix,

        Thanks for your reply. I almost wanted to reply there as well, but I tested first if your Rich Schema markup really works. You are right that it doens’t give any errors, but if you look in the Rich Snippet testing tool, you can not see a breadcrumb on your page, and with a page from it does. Please check:
        (your page, shows normal URL) ( page, with breadcrumb)

        What do you think of this?

        Kind regards,


        1. Okay, that’s a good point. It really seems Google does prefer RDFa for breadcrumbs…

          Thanks for this information! I think we’ll have to see how everything evolves. So Yoast is probably right, nonetheless I hope Google will soon add the same kind of support to markup.

          I guess for now we should really stick with RDFa, but I would certainly like to use Schema all over instead of mixing up different types of markup. I will try to stay up-to-date on this topic.

          Thanks again!

          1. Do you think we can overwrite the HTML output for Yoast breadcrumbs without losing this when we update the plugin? I’m curious what you think of the in my opinion ‘no so good’ HTML.

          2. Sorry, but I’m currently not really getting what you mean. Could you maybe elaborate on this? So the Yoast plugin currently uses span elements for the breadcrumbs right? What exactly do you think it should look like?

            As of modifying the plugin, I’m sure there is a way without losing changes since there are enough filters to modify the breadcrumb code (like in my SchemaOrg_Breadcrumbs class in the above article).

          3. Ok Felix, that’s a good thing. I\’m not that good in coding in into the plugin, but I do know what I want for ‘HTML’. And you are right, now Yoast uses span elements, and that is not the way I want it. Also, the brackets “>” or what ever you choose are coded in the HTML, but should actually be CSS (using “:before” for example.

            So here you can find an improved version of HTML for the breadcrumbs:


            They discuss the change here:


            I would do the HTML slightly different, I\’m going to send an e-mail to you how it should be (your business emailadress). Let me know you thoughts!

            Kind regards,


  2. Hello Felix,

    I think you should seriously revisit what you present in this post in case some other people follow your route. I just checked this very page in Google and it returned 12 errors in your page, including all the markups in breadcrumbs. I am looking for a way to do it correctly and came upon your page to have seen it. Good luck.

    1. Hello Bill,

      thanks a lot for telling me this. I checked it and I found out that the specification for breadcrumbs changed. So I updated the class to reflect these changes. It is correctly parsed now.

      The other errors you encountered in my page are results of the Disqus comment system using microdata markup incorrectly. I found a quick workaround for this, but it’s not a real solution. The problem is that I cannot edit the Disqus output, that sucks.

      Thanks again!

Leave a Reply

Your email address will not be published.