2016-11-10 86 views
0

我正在为客户端的网站工作。他们标记了他们在Microdata网站上展示的个人评论,但他们没有包含相应的aggregateRating属性。使用CSS隐藏'aggregateRating'

我已通知他们,他们需要包含aggregateRating propery才能让Google在其有机商品详情中显示明星。客户回应说这是好的,但我必须隐藏与网站互动的用户与aggregateRating - (ratingValue,ratingCount)相关的任何值。

我知道Google不赞成这种做法,但我想知道是否有人成功隐藏了使用CSS评论Schema.org?通过成功我的意思是谷歌仍然在有机上市中展示明星。

回答

2

没有必要使用CSS来隐藏您的模式。并非所有模式数据都必须显示在网页上。考虑JSON-LD模式,这都在head中,所以没有显示这些值。

HTML模式允许您标记网页上不可见的内容。

From Schema.org

有时候,一个网页都有,这将是有价值的标记信息,但信息不能标记,因为的方式,出现在页面上[...]

[...]

<meta itemprop="ratingValue" content="4" /> 

完整的代码片段:

<div itemscope itemtype="http://schema.org/Offer"> 
    <span itemprop="name">Blend-O-Matic</span> 
    <span itemprop="price">$19.95</span> 
    <div itemprop="reviews" itemscope itemtype="http://schema.org/AggregateRating"> 
    <img src="four-stars.jpg" /> 
    <meta itemprop="ratingValue" content="4" /> 
    <meta itemprop="bestRating" content="5" /> 
    Based on <span itemprop="ratingCount">25</span> user ratings 
    </div> 
</div>