schema.org - 使用 'publisher' 属性的正确方法 ("The attribute publisher.itemtype has an invalid value.")

标签 schema.org microdata google-rich-snippets

当我尝试使用 Google 的结构化数据测试工具验证我的结构化数据时,出现错误:

The attribute publisher.itemtype has an invalid value.

我在这条线上得到了:

<meta itemprop="publisher" content="My Real Name Here" />

如何为此属性提供有效值?

最佳答案

publisher 的期望值property 是另一个项目( OrganizationPerson )。

虽然 Schema.org 始终允许提供字符串值(就像您所做的那样),但 Google 的其中一项搜索功能可能需要特定的值类型(例如 Organization value for their Articles rich result for AMP HTML pages)。如果您不关心(或无法满足)此功能,则可以忽略 SDTT 中的错误。

使用字符串值的问题:不清楚发布者是个人还是组织,并且无法提供有关发布者的额外数据。

如果你想提供一个项目,它可能看起来像:

<div itemprop="publisher" itemscope itemtype="http://schema.org/Person">
  <p itemprop="name">NewGuy</p>
</div>
<div itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
  <p itemprop="name">NewGuy Inc.</p>
</div>

关于schema.org - 使用 'publisher' 属性的正确方法 ("The attribute publisher.itemtype has an invalid value."),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43602731/

相关文章:

html - 把 HTML5 Microdata 放在预览 block 上好不好?

google-search-console - 星级评分未显示在 Google 中

product - 如何用 Microdata 指示 Schema.org 'Product' 没有全局标识符?

html - 如何使用 "UserComments"模式项?

microdata - 'itemscope' 之外的属性被假定属于 'WebPage' ,但这会创建无效的微数据

schema.org - 使 'Review' 属于 Microdata 中的 'Product'

HTML 组织微数据就在关于我们页面或首页也

html - Microdata schema.org 中多次出现相同的 itemprop

javascript - 如何使用 JSON-LD 标记面包屑列表中的最后一个非链接项

html - 关于 'Question' 类型 : "Missing a QAPage markup item on page to which this item should be associated." 的警告