6

用作参考:https ://support.google.com/webmasters/answer/146750?hl=en

您会注意到在“产品”下有一个类别属性,并且页面下方还有一个示例:

<span itemprop="category" content="Hardware > Tools > Anvils">Anvils</span>

我已经完全模仿了:

<span itemprop="category" content="kitchen sinks > stainless steel sinks > undermount">undermount</span>

然而,当我使用 Google 的结构化数据工具对其进行测试时,我得到了错误:

错误:页面包含不属于架构的属性“类别”。

我在示例中也意识到,它使用的是 data-vocabulary.org→Product,而我使用的是 schema.org→Product。

现在在http://schema.org/Product上,它没有提到任何类别。schema.org 不提供类别吗?还是我错过了什么?

4

4 回答 4

4

category 是 schema/Offer 的 itemprop,而不是 schema/Product

要解决您的问题,请在产品中放置报价,并将类别附加到报价中。

于 2014-01-10T02:46:47.540 回答
4

注意:您使用的是contenton 属性span,该属性在 HTML5 或 Microdata 中无效(但在 RDFa 中)。

Schema.org 有一个category属性,但是不能用在它上面Product。根据您的内容,您可能希望使用OfferProduct 代替(另请参阅我的答案,其中使用 的示例category)。

于 2014-04-18T21:21:32.957 回答
1

我最近一直在研究 JSON-ld 和微数据,我相信在您的情况下,“类别”需要放在元标记中,而不是 span/div 标记中,最好是在您的项目之前。从逻辑上讲,您需要识别“undermount”是多余的,因为它已经包含在您的内容中。奇怪的是,模式类型服务具有“serviceType”作为属性,但产品没有等效项,否则这可能是另一种解决方法。对于您的内容“undermount”,请在您的跨度内使用 itemprop="name",该标签内不需要任何内容​​。

于 2018-08-18T02:48:19.790 回答
0
<meta itemprop="category" content="Hardware > Tools > Anvils > Anvils" />

这是schema.org接受的正确格式...

于 2016-03-23T07:18:16.093 回答