Why is my http://schema.org/BreadcrumbList not val

2020-04-14 08:18发布

问题:

I'm using schema.org microdata on my web site but I'm struggling with the BreadcrumbList as Google's structured data testing tool will not validate it. It looks correct and I can't see what's wrong.

You can click the above link to see the errors, but to summarise, Google says that the itemtype attribute has an invalid value for each of the items and also complains that the mainEntityOfPage attribute is missing from the list. I did try adding mainEntityOfPage in a meta tag but it still complained about it.

What am I doing wrong?

<ul itemscope="" itemtype="http://schema.org/BreadcrumbList">
    <li class="home" itemscope="" itemprop="itemListElement" itemtype="http://schema.org/ListItem">
        <a href="http://www.rossmod.co.uk/" title="Go to Home Page" itemprop="item"><span itemprop="name">Home</span></a>
        <span>/ </span>
        <meta itemprop="position" content="1">
    </li>
    <li class="category3" itemscope="" itemprop="itemListElement" itemtype="http://schema.org/ListItem">
        <a href="http://www.rossmod.co.uk/rc-cars.html" title="" itemprop="item"><span itemprop="name">RC Cars</span></a>
        <span>/ </span>
        <meta itemprop="position" content="2">
    </li>
    <li class="category10" itemscope="" itemprop="itemListElement" itemtype="http://schema.org/ListItem">
        <a href="http://www.rossmod.co.uk/rc-cars/car-kits.html" title="" itemprop="item"><span itemprop="name">Car Kits</span></a>
        <span>/ </span>
        <meta itemprop="position" content="3">
    </li>
    <li class="product">
        <strong>Tamiya Lunch Box. No ESC [58347]</strong>
    </li>
</ul>

回答1:

The breadcrumbs must use the breadcrumb property, and put this inside another itemscope (ideally http://schema.org/WebPage). You are also missing is itemprop="breadcrumb which must be right before your itemscope.

<div class="breadcrumbs" itemscope itemtype="http://schema.org/WebPage"> 
<ul itemprop="breadcrumb" itemscope="" itemtype="http://schema.org/BreadcrumbList">
<li class="home" itemscope="" itemprop="itemListElement" itemtype="http://schema.org/ListItem">
    <a href="http://www.rossmod.co.uk/" title="Go to Home Page" itemprop="item"><span itemprop="name">Home</span></a>
    <span>/ </span>
    <meta itemprop="position" content="1">
</li>
<li class="category3" itemscope="" itemprop="itemListElement" itemtype="http://schema.org/ListItem">
    <a href="http://www.rossmod.co.uk/rc-cars.html" title="" itemprop="item"><span itemprop="name">RC Cars</span></a>
    <span>/ </span>
    <meta itemprop="position" content="2">
</li>
<li class="category10" itemscope="" itemprop="itemListElement" itemtype="http://schema.org/ListItem">
    <a href="http://www.rossmod.co.uk/rc-cars/car-kits.html" title="" itemprop="item"><span itemprop="name">Car Kits</span></a>
    <span>/ </span>
    <meta itemprop="position" content="3">
</li>
<li class="product">
    <strong>Tamiya Lunch Box. No ESC [58347]</strong>
</li>
</ul>