Proper way to use the 'publisher' property (“The attribute publisher.itemtype has an invalid value.”)

…衆ロ難τιáo~ 提交于 2019-12-31 02:42:15

问题


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?


回答1:


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>


来源:https://stackoverflow.com/questions/43602731/proper-way-to-use-the-publisher-property-the-attribute-publisher-itemtype-ha

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!