squirrelscan
GitHub

AggregateRating: ratingValue, ratingCount and review checks

Rating markup missing ratingValue or a review count, and Review nodes with no author or reviewRating. squirrel checks both shapes.

What AggregateRating is

AggregateRating is the schema.org type for a summary of many ratings of one thing: ratingValue holds the average, ratingCount or reviewCount holds how many it is drawn from, and bestRating holds the top of the scale, defaulting to 5. It attaches to the thing being rated, usually a Product or a LocalBusiness.

A single Review is the other half. Google’s review snippet guidance asks for an author and a reviewRating, recommends datePublished, and expects the review to be about a specific item rather than the site as a whole. Its structured data policies require the rating to be visible to readers on the same page.

What squirrel checks

The rule reads every script[type="application/ld+json"] on the page and flattens each one, so a node nested in an @graph wrapper counts the same as a top-level node. It does not walk into ordinary properties. From those nodes it collects an aggregateRating property, a node whose @type is exactly AggregateRating, a review property, and any node whose @type is exactly Review. A review entry or an aggregateRating written as a node reference ({"@id": "…#r1"}) is read from the node with that @id anywhere in the page’s JSON-LD, and a review both referenced and present as its own node is judged once. It emits one to three checks:

  • review-schema: reports at info status with the message No Review or AggregateRating schema found when neither is present. No further checks run.
  • aggregate-rating: warns with the message AggregateRating missing ratingValue when ratingValue is falsy. Only when it is present does the count get checked, warning with AggregateRating missing ratingCount/reviewCount when neither ratingCount nor reviewCount is present. With both it passes with AggregateRating: 4.7/5 (218 reviews), filling in the value and the count.
  • individual-reviews: warns with the message N review(s) missing author or rating for entries lacking author or reviewRating, and passes with N valid review(s) found for those that have both. Both can appear on the same page.

The pass message prints the scale as /5 regardless of what bestRating says, so a rating on a 10-point scale is still rendered as out of 5. When several nodes carry an aggregateRating, the last one wins. An AggregateRating that a generator has wrapped in an array is unwrapped and the first object entry is used. Every property test is a truthiness test rather than a presence test, so a property present but empty, 0 or false counts as missing.

How to fix it

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Product",
  "name": "Ceramic pour-over dripper",
  "aggregateRating": {
    "@type": "AggregateRating",
    "ratingValue": "4.7",
    "ratingCount": "218",
    "bestRating": "5"
  }
}
</script>

Attach the rating to the thing it rates, not to the page or the site, and print the same numbers in the page content where a reader can see them.

The common false positive is a rating rendered by a third-party widget such as Trustpilot or Yotpo. The numbers arrive after load, so a raw-HTML crawl sees markup with no matching visible text. That case is handled by schema/rating-scope, which recognises the widgets, rather than by this rule.

Rule IDschema/review
CategoryStructured Data
ScopePer-page
Severitywarning
Weight5/10

Enable / disable

Disable this rule

[rules]
disable = ["schema/review"]

Disable all Structured Data rules

[rules]
disable = ["schema/*"]

Enable only this rule

[rules]
enable = ["schema/review"]

enable replaces the default ["*"], so this is the only rule selected. Leave disable out: a rule that matches any disable pattern is skipped even when enable names it. Only an enabled setting under a rule’s own [rule_options] table overrides both lists.

Structured data findings ship in every audit next to the core SEO, performance and agent experience rules. See Fix SEO issues with AI for how an agent works through a report.

References

Check your site

Run squirrel audit https://example.com and open the Structured Data section of the report. Each rated page shows the value and count it declared. Signed-out local audits need no account and cost nothing. Signed-in audits spend credits.

Type to search…

↑↓ navigate↵ openesc close