XooCode(){

AggregateRating

AggregateRating is how schema.org represents an averaged review score. It holds the rating value, the scale (best and worst), and the number of reviews or ratings that produced it. Google uses it to display the yellow star snippet in search results, one of the most visible rich result features. It nests inside Product, LocalBusiness, Recipe, SoftwareApplication, and most types that accept reviews.

Full example of schema.org/AggregateRating json-ld markup

The markup is verified as valid with Rich Results Test from Google.

schema.org/AggregateRating
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "AggregateRating",
  "@id": "https://xoocode.com/shop/xootee-classic#rating",
  "name": "Customer rating for XooTee Classic",
  "itemReviewed": {
    "@type": "Product",
    "@id": "https://xoocode.com/shop/xootee-classic#product",
    "name": "XooTee Classic"
  },
  "ratingValue": 4.7,
  "bestRating": 5,
  "worstRating": 1,
  "reviewCount": 238,
  "ratingCount": 412
}
</script>

ratingValue, bestRating, worstRating

ratingValue is the averaged score. bestRating and worstRating define the scale. Google defaults to a 1-5 scale if you omit them, but if your rating system uses a different range (1-10, 0-100), you must specify both. All three should be numbers, not strings. A ratingValue of "4.7" (quoted) is technically a string and some processors reject it.

reviewCount vs ratingCount

reviewCount is the number of full reviews (with text). ratingCount is the number of ratings (just a star score, no text). Google accepts either. If you have both, include both. If your system only tracks one, use whichever applies. Do not set both to the same number unless every rating also has a review text.

itemReviewed

When AggregateRating appears standalone (not nested inside a Product or LocalBusiness), set itemReviewed to identify what is being rated. Use the @type and name at minimum. When AggregateRating is nested inside its parent type, itemReviewed is redundant and can be omitted.

Minimal valid version

The smallest markup that still produces a valid AggregateRating entity. Use it as the floor. Reach for the advanced example above when you want search engines and AI agents to understand more about your content.

schema.org/AggregateRating (minimal)
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "AggregateRating",
  "ratingValue": 4.7,
  "reviewCount": 238
}
</script>

Google rich results this unlocks

AggregateRating is a structural type. It does not produce a rich result on its own.

Its value comes from combining it with a primary type whose markup earns a rich result (Article, Product, Event, and so on). AggregateRating becomes the trunk that the primary type branches off viamainEntityorbreadcrumb. Include it on every page as the backbone of your markup.

Common AggregateRating mistakes

Mistakes that pass validation but silently fail to earn rich results or mislead consumers walking the graph. Avoid these and your markup will be ahead of most sites in the wild.

  1. 01

    ratingValue as a quoted string instead of a number

    Wrong
    "ratingValue": "4.7"
    Right
    "ratingValue": 4.7

    schema.org defines ratingValue as a Number. A quoted string passes JSON validation but is semantically wrong. Google is forgiving about this today, but some processors reject it and the schema.org spec is explicit. Use an unquoted numeric value for ratingValue, bestRating, worstRating, reviewCount, and ratingCount.

  2. 02

    Non-default scale without bestRating and worstRating

    Wrong
    "ratingValue": 94
    Right
    "ratingValue": 94, "bestRating": 100, "worstRating": 0

    Google defaults to a 1-5 scale. A ratingValue of 94 on a 1-5 scale would be nonsensical and Google will likely ignore it or display it incorrectly. If your scale is not 1-5, you must include bestRating and worstRating so Google can normalize the display.

  3. 03

    reviewCount and ratingCount set to the same number

    Wrong
    "reviewCount": 238, "ratingCount": 238
    Right
    "reviewCount": 238, "ratingCount": 412

    reviewCount is reviews with text. ratingCount is all ratings (including those without text). They should only be equal if every single rating includes a review body. If your system does not distinguish between the two, include just one. Setting both to the same number when they are not actually equal misleads search engines about the depth of review content.

  4. 04

    Missing itemReviewed on standalone AggregateRating

    Wrong
    (standalone AggregateRating block with no itemReviewed)
    Right
    "itemReviewed": { "@type": "Product", "name": "XooTee Classic" }

    When AggregateRating is not nested inside its parent type (Product, LocalBusiness, etc.), Google needs itemReviewed to know what the rating applies to. Without it, the rating is an orphan and Google cannot associate it with any entity. When nested inside a parent, itemReviewed is optional because the context is implicit.

About the example data

This rating is for the XooTee Classic shirt sold at Xoo Code Shop Dunmore. The 4.7-star average from 238 reviews also appears as a nested block inside the Product example. Here it is shown standalone with itemReviewed so you can see the full AggregateRating structure.

Comments

Loading comments...

Leave a comment