Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am implementing structured data into an app with the AggregateRating markup. The problem is that when 0 ratings are present the rating value is empty. I get the following error when using Google Structured Data Testing Tool.

Field ratingValue may not be empty.

<div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
<meta itemprop="reviewCount" content="0">
<meta itemprop="ratingValue" content="">
...
</div>

The app uses the default 1 to 5 rating scale.

Is there a default value that complies with Schema.org that can be passed to when the ratingValue is empty? I don't want to pass it an arbitrary number on the scale just to avoid the error...

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.4k views
Welcome To Ask or Share your Answers For Others

1 Answer

The Google Structured Data Testing Tool error you quote is misleading. It’s not an error with your use of Schema.org or Microdata.

Instead it just means that Google probably won’t consider displaying their Aggregate Ratings Rich Snippet for your document in Google Search (naturally, because a rating value would be required for this).

However, providing the empty string as value for the ratingValue property doesn’t really make sense here. So why not simply omit the property? And ideally you would omit the aggregateRating property with the AggregateRating altogether if you don’t have any reviews yet.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...