Schema itemprop属性被标记为无效,如何解决?

时间:2014-05-27 23:46:51

标签: w3c-validation schema.org microdata

在我目前的WordPress主题中,我已经为每个可能的元素实现了Microdata(使用Schema.org)。但是在我在validator.w3.org上运行标记验证后,它仅在itemprop属性上显示21个错误。

错误是:

Validation Output: 21 Errors

Error Line 76, Column 131: The itemprop attribute was specified, but the element is not a property of any item.

…op="mainContentOfPage" itemscope="itemscope" itemtype="http://schema.org/Blog">

✉
Error Line 78, Column 225: The itemprop attribute was specified, but the element is not a property of any item.

…scope="itemscope" itemtype="http://schema.org/BlogPosting" itemprop="blogPost">

✉
Error Line 81, Column 44: The itemprop attribute was specified, but the element is not a property of any item.

…lass="entry-title" itemprop="headline"><a href="http://www.bloggingspell.com/a…

✉
Error Line 86, Column 42: The itemprop attribute was specified, but the element is not a property of any item.

<div class="entry-thumb" itemprop="image">

✉
Error Line 91, Column 43: The itemprop attribute was specified, but the element is not a property of any item.

<div class="entry-summary" itemprop="text">

✉
Error Line 100, Column 213: The itemprop attribute was specified, but the element is not a property of any item.

…scope="itemscope" itemtype="http://schema.org/BlogPosting" itemprop="blogPost">

✉
Error Line 103, Column 44: The itemprop attribute was specified, but the element is not a property of any item.

…lass="entry-title" itemprop="headline"><a href="http://www.bloggingspell.com/a…

✉
Error Line 108, Column 42: The itemprop attribute was specified, but the element is not a property of any item.

<div class="entry-thumb" itemprop="image">

✉
Error Line 113, Column 43: The itemprop attribute was specified, but the element is not a property of any item.

<div class="entry-summary" itemprop="text">

✉
Error Line 122, Column 224: The itemprop attribute was specified, but the element is not a property of any item.

…scope="itemscope" itemtype="http://schema.org/BlogPosting" itemprop="blogPost">

✉
Error Line 125, Column 44: The itemprop attribute was specified, but the element is not a property of any item.

…lass="entry-title" itemprop="headline"><a href="http://www.bloggingspell.com/m…

✉
Error Line 130, Column 42: The itemprop attribute was specified, but the element is not a property of any item.

<div class="entry-thumb" itemprop="image">

✉
Error Line 135, Column 43: The itemprop attribute was specified, but the element is not a property of any item.

<div class="entry-summary" itemprop="text">

✉
Error Line 144, Column 229: The itemprop attribute was specified, but the element is not a property of any item.

…scope="itemscope" itemtype="http://schema.org/BlogPosting" itemprop="blogPost">

✉
Error Line 147, Column 44: The itemprop attribute was specified, but the element is not a property of any item.

…lass="entry-title" itemprop="headline"><a href="http://www.bloggingspell.com/s…

✉
Error Line 152, Column 42: The itemprop attribute was specified, but the element is not a property of any item.

<div class="entry-thumb" itemprop="image">

✉
Error Line 157, Column 43: The itemprop attribute was specified, but the element is not a property of any item.

<div class="entry-summary" itemprop="text">

✉
Error Line 166, Column 230: The itemprop attribute was specified, but the element is not a property of any item.

…scope="itemscope" itemtype="http://schema.org/BlogPosting" itemprop="blogPost">

✉
Error Line 169, Column 44: The itemprop attribute was specified, but the element is not a property of any item.

…lass="entry-title" itemprop="headline"><a href="http://www.bloggingspell.com/a…

✉
Error Line 174, Column 42: The itemprop attribute was specified, but the element is not a property of any item.

<div class="entry-thumb" itemprop="image">

✉
Error Line 179, Column 43: The itemprop attribute was specified, but the element is not a property of any item.

<div class="entry-summary" itemprop="text">

我已经按照网站yoast.com和bloggingwizard.com实施了Microdata。这两个在W3C验证器上显示有效,但我的网站不是。有人可以帮我解决这个问题吗?

以下是验证检查的网址:

http://validator.w3.org/check?uri=http%3A%2F%2Fwww.bloggingspell.com%2F&charset=%28detect+automatically%29&doctype=Inline&group=0

这是我的网站:

http://www.bloggingspell.com/

我的主题:Crangasi

1 个答案:

答案 0 :(得分:6)

您的itemprop元素上有main,但此属性所属的父项目没有。

当您使用mainContentOfPage时,您可能希望拥有WebPage项。但请注意,此属性不能包含Blog值,它必须是WebPageElement

因此,您可能希望从itemprop="mainContentOfPage"删除main