WordPress SEO Breadcrumbs

The “Internal Links” (breadcrumbs) feature from Yoast’s WordPress SEO plugin is super useful when doing large content based sites, however it doesn’t generate HTML 5 compatible HTML. The span xmlns code breaks the validation, so we’ll convert it to supported Microdata format instead.

WordPress SEO Breadcrumbs

We can fix this with a simple function in functions.php

add_filter ('wpseo_breadcrumb_output','mc_microdata_breadcrumb');
 
function mc_microdata_breadcrumb ($link_output) {
$link_output = preg_replace(array('#<span xmlns:v="http://rdf.data-vocabulary.org/#">#','#<span typeof="v:Breadcrumb"><a href="(.*?)" .*?'.'>(.*?)</a></span>#','#<span typeof="v:Breadcrumb">(.*?)</span>#','# property=".*?"#','#</span>$#'), array('','<span itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="$1" itemprop="url"><span itemprop="title">$2</span></a></span>','<span itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><span itemprop="title">$1</span></span>','',''), $link_output);
 
return $link_output;
}

This will return HTML 5 valid Microdata format code.

источник