Google Search Console 和测试工具给出关于 best/worst AggregateRating 值的不同错误

Google Search Console and Testing Tool giving different errors about best/worst AggregateRating values

在 Google Search Console 上,我收到错误 missing best and worst rating. But when I tested the link on testing tool, I am getting:

  1. Failed to normalize the rating value.

  2. Your rating value was out of the default range, you must provide best and worst values.

代码如下:

<h3>Reviews</h3>
<div class="average-rating" itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
<p class="rating-title">Average Rating</p>
<div class="rating-box">
    <div class="average-value" itemprop="ratingValue">0/5</div>
    <div class="review-amount" itemprop="ratingCount">0 rating</div>
</div>

当我将评级值更改为

<div class="average-value" itemprop="ratingValue">0/5</div> 

或对此

<div class="average-value" itemprop="ratingValue">0/-454545</div>

它gives a warning:

0 rating (The value provided for ratingCount must be an integer.)

我该如何解决这个问题?

min/max 属性是普通的 HTML 属性,它们不会影响微数据(顺便说一下,它们不能用在 div 元素上)。

在Schema.org中,可以用worstRating and bestRating指定worst/best评级。如果您不提供这些属性,则假定为“0”和“5”。

如果您修复其他错误(ratingCount 必须是“0”,而不是“0 评级”;最好使用“0”而不是“0/5”作为 ratingValue),可以省略worstRating/bestRating。但通常最好是明确的,所以你可以添加:

<meta itemprop="worstRating" content="0" />
<meta itemprop="bestRating" content="5" />

或:

<meta itemprop="worstRating" content="0" />
<span itemprop="ratingValue">0</span>/<span itemprop="bestRating">5</span>