Schema.org usage of WPHeader (or how to add structured data to ‘Hero’ images

一世执手 提交于 2019-12-05 21:22:26

WPHeader

The WPHeader type is for the header of a page (i.e., WebPage).

If you add properties to WPHeader, these properties describe the header (!), not the page.

So, for example, the name might be "Header", the image might be a screenshot of the header etc. This is of course typically not useful to have on a page, and typically not useful to provide as structured data, so my recommendation is not to use them.

WebPage

It seems to me that the WebPage type is what you want. Its name is the name of the page, its description is the description of the page etc.

If the page is about a single entity (e.g., an Event), then you could use the more specific ItemPage type. With the mainEntity property, you can specify the primary entity of that page.

The ItemPage might share some property values with the Event (e.g., the description might be the same), but there might also be slight differences (e.g., the name of the WebPage might contain the site name in addition).

<body itemscope itemtype="http://schema.org/ItemPage">

  <!-- properties about the event page -->

  <article itemprop="mainEntity" itemscope itemtype="http://schema.org/Event">
    <!-- properties about the event -->
  </article>

  <!-- properties about the event page -->

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