当我尝试使用 Google 的结构化数据测试工具验证我的结构化数据时,出现错误:
The attribute publisher.itemtype has an invalid value.
我在这条线上得到了:
<meta itemprop="publisher" content="My Real Name Here" />
如何为此属性提供有效值?
最佳答案
publisher
的期望值property 是另一个项目( Organization
或 Person
)。
虽然 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/