Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Schema.org AggregateRating markup when ratingValue is Empty

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...

like image 387
JeffD23 Avatar asked Sep 27 '15 02:09

JeffD23


People also ask

What is snippet schema markup?

Schema markup, found at Schema.org, is a form of microdata. Once added to a webpage, schema markup creates an enhanced description (commonly known as a rich snippet), which appears in search results.

Where do I put the schema markup code on my website?

But for the most part, you will want to place the schema markup HTML in the footer of every page of your website. We are going to do that by clicking on Appearance, then Customize, then Widgets, and then the footer section in which we want to place the code.

What is schema markup and how does it help SEO?

What is a Schema Markup? Schema markup informs the search engine precisely what your content is trying to convey on your web page. It converts unstructured data into structured data. Adding schema will help the search engine crawl better, raising the websites ranking while keeping other best practives of SEO in mind.


1 Answers

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.

like image 101
unor Avatar answered Sep 29 '22 04:09

unor