我已将以下html代码添加到我们网站之一的产品页面上:
<div itemtype="http://schema.org/Offer" itemscope="" itemprop="offers">
<div class="product-type-data">
<div itemtype="http://schema.org/Offer" itemscope="" itemprop="offers" class="price-box">
<span id="product-price-118" class="regular-price">
<span itemprop="price" class="price">30,00 €</span>
</span>
</div>
<p class="availability in-stock">Verfügbarkeit: <span>Auf Lager</span></p>
<meta content="http://schema.org/InStock" itemprop="availability">
<div class="clearfix"></div>
</div>
<meta content="EUR" itemprop="priceCurrency">
<meta content="30" itemprop="price">
我在网站站长工具中测试此错误时,在结构化数据中收到错误消息:“结构类型数据中的属性要约未被Google识别为Google”(仅适用于具有类“price-box”的div)。
我还在这里附上网站管理员的错误快照。
有谁能指出我要去哪里的正确方向?
谢谢
最佳答案
我知道这是一个老问题,但是我想回答,以防其他人需要答案。我还要假设报价是针对某种产品的(这不是必需的,但对于大多数人来说可能很常见)。
首先,我想参考一些资源来阅读有关该主题的内容。
https://schema.org/
Google Structured Data Test Tool
Google Product Reference
我还想澄清一下,该问题与微数据有关,而不是与JSON-LD有关,因此我将以微数据格式进行答复。
我相信您的问题是您在“要约”中有一个“要约”。试试这个代码:
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<div class="product-type-data">
<div class="price-box">
<span id="product-price-118" class="regular-price">
<span class="price">30,00 €</span>
</span>
</div>
<p class="availability in-stock">Verfügbarkeit: <span>Auf Lager</span></p>
<div class="clearfix"></div>
</div>
<meta content="http://schema.org/InStock" itemprop="availability">
<meta content="30" itemprop="price">
<meta content="EUR" itemprop="priceCurrency">
</div>
如果您将以上代码放入Google测试工具中,它将进行验证。
如果您想要另一个示例,请转到上面的google产品参考链接,然后在示例部分(单个产品页面)中,选择Microdata标签,然后选择“查看标记”。这将为您提供更完整的示例。如果Google删除了此代码,我将其包含在下面。
<div itemtype="http://schema.org/Product" itemscope>
<meta itemprop="mpn" content="925872" />
<meta itemprop="name" content="Executive Anvil" />
<link itemprop="image" href="https://example.com/photos/16x9/photo.jpg" />
<link itemprop="image" href="https://example.com/photos/4x3/photo.jpg" />
<link itemprop="image" href="https://example.com/photos/1x1/photo.jpg" />
<meta itemprop="description" content="Sleeker than ACME's Classic Anvil, the Executive Anvil is perfect for the business traveler looking for something to drop from a height." />
<div itemprop="offers" itemtype="http://schema.org/Offer" itemscope>
<link itemprop="url" href="https://example.com/anvil" />
<meta itemprop="availability" content="https://schema.org/InStock" />
<meta itemprop="priceCurrency" content="USD" />
<meta itemprop="itemCondition" content="https://schema.org/UsedCondition" />
<meta itemprop="price" content="119.99" />
<meta itemprop="priceValidUntil" content="2020-11-05" />
<div itemprop="seller" itemtype="http://schema.org/Organization" itemscope>
<meta itemprop="name" content="Executive Objects" />
</div>
</div>
<div itemprop="aggregateRating" itemtype="http://schema.org/AggregateRating" itemscope>
<meta itemprop="reviewCount" content="89" />
<meta itemprop="ratingValue" content="4.4" />
</div>
<div itemprop="review" itemtype="http://schema.org/Review" itemscope>
<div itemprop="author" itemtype="http://schema.org/Person" itemscope>
<meta itemprop="name" content="Fred Benson" />
</div>
<div itemprop="reviewRating" itemtype="http://schema.org/Rating" itemscope>
<meta itemprop="ratingValue" content="4" />
<meta itemprop="bestRating" content="5" />
</div>
</div>
<meta itemprop="sku" content="0446310786" />
<div itemprop="brand" itemtype="http://schema.org/Thing" itemscope>
<meta itemprop="name" content="ACME" />
</div>
</div>
关于google-webmaster-tools - 错误:结构化数据中的“The property offers is not recognized by Google for an object of type Offer”,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/37203124/