使用“publisher"属性的正确方法(“属性publisher.itemtype 的值无效.") [英] Proper way to use the 'publisher' property ("The attribute publisher.itemtype has an invalid value.")

查看:63
本文介绍了使用“publisher"属性的正确方法(“属性publisher.itemtype 的值无效.")的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

<块引用>

属性publisher.itemtype 的值无效.

我在这条线上得到了:

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

解决方案

publisher 属性是另一项(OrganizationPerson).

虽然 Schema.org 始终允许提供字符串值(就像您一样),但 Google 可能需要为其搜索功能之一提供特定的值类型(例如,AMP HTML 页面的文章富媒体搜索结果的组织).如果您不关心(或无法获得)此功能,则可以忽略 SDTT 中的错误.

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

如果您想提供一个项目,它可能如下所示:

<p itemprop="name">NewGuy</p>

<p itemprop="name">NewGuy Inc.</p>

When I attempt to validate my structured data using Google's Structured Data Testing tool, I get an error:

The attribute publisher.itemtype has an invalid value.

I am getting that on this line:

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

How do I provide a valid value for this property?

解决方案

The expected value of the publisher property is another item (Organization or Person).

While Schema.org always allows to provide a string value (like you do), Google might require a certain value type for one of their search features (e.g., an Organization value for their Articles rich result for AMP HTML pages). If you don’t care about (or can’t qualify for) this feature, you can ignore the error in the SDTT.

The problems with using a string value: it’s not clear if the publisher is a person or an organization, and it’s not possible to provide additional data about the publisher.

If you want to provide an item, it could look like:

<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>

这篇关于使用“publisher"属性的正确方法(“属性publisher.itemtype 的值无效.")的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆