验证错误:"指定了itemprop属性,但该元素不是任何项目的属性"

rpa*_*anm 23 seo w3c-validation meta-tags microdata schema.org

为了更好的搜索引擎优化,我需要在我的页面上添加一些元素:

<!-- Schema.org markup for Google+ -->
<meta itemprop="name" content="The Name or Title Here">
<meta itemprop="description" content="This is the page description">
<meta itemprop="image" content="http://www.example.com/image.jpg"> 
Run Code Online (Sandbox Code Playgroud)

这是来源.

然后我在标记验证服务上检查此代码:

<!DOCTYPE html>
<html>
<head lang="en">
  <meta itemprop="name" content="The Name or Title Here">
  <meta itemprop="description" content="This is the page description">
  <meta itemprop="image" content="http://www.example.com/image.jpg">
  <meta charset="UTF-8">
  <title>My title</title>
</head>
<body>
  My body.
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

抛出这个错误:

第4行,第57列:itemprop指定了属性,但该元素不是任何项的属性.

 <meta itemprop="name" content="The Name or Title Here">
Run Code Online (Sandbox Code Playgroud)

第5行,第70列:itemprop指定了属性,但该元素不是任何项的属性.

 <meta itemprop="description" content="This is the page description">
Run Code Online (Sandbox Code Playgroud)

第6行,第68列:itemprop指定了属性,但该元素不是任何项的属性.

 <meta itemprop="image" content="http://www.example.com/image.jpg">
Run Code Online (Sandbox Code Playgroud)

我怎样才能解决这个问题?

uno*_*nor 29

你应该明确地提供一个类型,这些属性(name,description,image)属于.

在Schema.org中,一切都是Thing.Thing有许多子类型,列在"更具体的类型"下.从那里开始,为您的内容选择最具体的类型.

例如:WebPage,Article或可能BlogPosting.

它看起来像(WebPage在这里使用例子):

<html itemscope itemtype="http://schema.org/WebPage">
Run Code Online (Sandbox Code Playgroud)