I've been trying to figure out if it is possible to override the output of the Yoast SEO breadcrumb class rather than editing the original file?

Each url segment is wrapped in <span></span> but i'd like to wrap it in <li></li>

Is this possible? Any pointers in the right direction would be appreciated.

Thank you.


In cases like this, open the plugin files in a good code editor and search for the elements you need, as there may be an useful hook.

So, for this we have the filter wpseo_breadcrumb_single_link.

Maybe you can replace span for li in $link_output, or use $link to build your own:

add_filter( 'wpseo_breadcrumb_single_link', 'filter_breadcrumb_wpse_88254', 10, 2 );

function filter_breadcrumb_wpse_88254( $link_output, $link )
    // do your stuff
    return $link_output;
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.