Invalid rating value

Moderate effort

Found on 3% of audited stores.

Fix the AggregateRating.ratingValue in your structured data so it is a valid number between 1 and 5 (or your declared scale's minimum and maximum).

What it is

Structured data is hidden code on your product pages that tells search engines facts about your store — things like star ratings, prices, and product names. The `AggregateRating` block specifically communicates your average customer rating. The `ratingValue` field inside that block must be a real number (e.g. 4.3) that falls between the declared minimum and maximum rating values — typically 1 to 5. When it is missing, set to 0, left blank, or formatted incorrectly, search engines consider the entire rating block invalid.

Why it matters

A valid `AggregateRating` is what earns you gold star snippets in Google Search results — those eye-catching stars visible directly on the results page before a shopper even clicks. Stores with star snippets consistently see higher click-through rates, which drives more organic traffic and sales. An invalid or zero `ratingValue` means Google ignores your rating markup entirely, stripping those stars from your listing and handing the visual advantage to competitors. For Answer Engine Optimisation (AEO), valid rating structured data also influences how AI-powered answer engines and shopping assistants surface and rank your products in direct answers.

How to fix it

  1. Locate every instance of AggregateRating structured data across your site — this is commonly embedded in product pages, collection pages, or a global theme file.
  2. Check the ratingValue field: it must be a number (integer or decimal) greater than or equal to your bestRating minimum (default 1) and less than or equal to your bestRating maximum (default 5). A value of 0 is always invalid.
  3. Ensure you also declare the companion fields correctly: ratingCount (total number of reviews) must be present and greater than 0, bestRating should be set to 5 (or your scale's maximum), and worstRating should be set to 1 (or your scale's minimum).
  4. If your rating is dynamically generated (pulled from a reviews app or database), trace the data source — a zero value usually means no reviews have been collected yet, the app has not synced, or a code bug is outputting a fallback of 0 instead of omitting the block.
  5. Remove or suppress the entire AggregateRating block for any product or page that has zero reviews or no valid rating data — outputting invalid markup is worse than outputting none.
  6. After making changes, validate your updated pages using the Google Rich Results Test to confirm the structured data is error-free before re-crawling.

Fix it on your platform

Pick your platform for the exact steps.

How to fix invalid rating value on Shopify
  1. Go to Online Store → Themes → click 'Customize' on your active theme, then exit back to the theme editor and choose 'Edit code' (three-dot menu next to the theme name).
  2. Search for 'ratingValue' across all theme files using the search box in the code editor. The most common locations are product.json, product-template.liquid, main-product.liquid, or a snippets/structured-data.liquid file.
  3. Find the line outputting ratingValue and confirm it references a real Liquid variable such as {{ product.metafields.reviews.rating.value }} or a reviews app variable — NOT a hardcoded 0 or an empty string.
  4. If you use a reviews app (Judge.me, Yotpo, Okendo, Stamped, etc.), check that app's settings for 'Rich Snippets' or 'SEO structured data' — most apps have a toggle to inject valid AggregateRating automatically. Disable any manual duplicate markup.
  5. Add a Liquid conditional to suppress the entire AggregateRating block when no reviews exist: wrap the block in {% if product.metafields.reviews.rating_count > 0 %} … {% endif %} (exact metafield key depends on your reviews app).
  6. Save, then test a product URL in the Google Rich Results Test (search.google.com/test/rich-results) to confirm stars appear with no errors.
How to fix invalid rating value on WooCommerce
  1. If you use an SEO plugin (Yoast SEO, Rank Math, or All in One SEO), go to that plugin's settings and locate the 'Schema' or 'Structured Data' section — ensure the WooCommerce product schema is enabled and set to pull the real WooCommerce average rating.
  2. In Yoast SEO: SEO → Search Appearance → Content Types → Products → Schema tab → confirm 'Product' and 'AggregateRating' are enabled. Yoast reads WooCommerce's native rating automatically when reviews are present.
  3. In Rank Math: Rank Math → Titles & Meta → Products → Schema → ensure Schema Type is 'Product'; Rank Math auto-populates ratingValue from WooCommerce reviews.
  4. If you have custom or theme-level structured data, open your theme's functions.php or the responsible template file (single-product.php, woocommerce/single-product.php) and find where AggregateRating is built. Replace any hardcoded ratingValue with wc_get_product()->get_average_rating() and wrap the entire block in a check: if ( $product->get_review_count() > 0 ).
  5. Ensure WooCommerce product reviews are enabled: WooCommerce → Settings → Products → Reviews → check 'Enable product reviews'.
  6. Validate with the Google Rich Results Test after saving.
How to fix invalid rating value on BigCommerce
  1. Go to Storefront → Themes → click 'Advanced' → 'Edit Theme Files' on your active theme (Stencil).
  2. Search for 'ratingValue' inside templates/pages/product.html or the theme's schema.json / structured data partial.
  3. Confirm the value references a Handlebars variable such as {{product.rating.average}} rather than a static 0. BigCommerce's native Stencil Handlebars context exposes product.rating.average and product.rating.count.
  4. Add a conditional to suppress the AggregateRating block when there are no reviews: {{#if product.rating.count}} … {{/if}}.
  5. If you use a third-party reviews app (PowerReviews, Yotpo, etc.), check whether that app injects its own structured data — disable any conflicting manual markup in the theme to avoid duplicate or zeroed-out blocks.
  6. Save and push the theme, then test a product URL in the Google Rich Results Test.
How to fix invalid rating value on Wix
  1. Wix injects AggregateRating structured data automatically for Wix Stores products when reviews exist and the Wix Reviews app is installed and active.
  2. In your Wix dashboard, go to App Market and confirm 'Wix Reviews' (or 'Product Reviews') is installed on your store.
  3. Open a product page in the Editor and confirm reviews are enabled for that product — some products may have reviews toggled off individually.
  4. If you have added custom structured data via Wix's 'Add Structured Data Markup' panel (Settings → Advanced → Structured Data Markup), review that custom JSON-LD and correct or remove any ratingValue: 0 entries. Suppress the AggregateRating block entirely if the product has no reviews.
  5. For Wix Studio / custom Velo code, locate the structured data injected via $w.onReady or wixSeo.setStructuredData and apply the same conditional: only include AggregateRating when reviewCount > 0 and ratingValue >= 1.
  6. Publish your site changes and validate in the Google Rich Results Test.
How to fix invalid rating value on Squarespace
  1. Squarespace automatically generates product structured data including AggregateRating. If you see an invalid ratingValue it is most likely caused by a Code Injection block containing custom JSON-LD that overrides or conflicts with Squarespace's native output.
  2. Go to Settings → Advanced → Code Injection (site-wide) and Pages → (individual page) → Advanced → Page Header Code Injection. Search for any JSON-LD blocks containing 'ratingValue' and correct or remove them.
  3. If you have a third-party reviews block or app embedded on product pages, check its documentation for a 'rich snippets' or 'structured data' setting — disable it if Squarespace's native schema is already active.
  4. Squarespace's native AggregateRating is only output when there are actual published reviews on the product; no fix is needed beyond ensuring reviews are present and approved.
  5. After any code injection changes, use the Google Rich Results Test on the product URL to confirm the structured data is valid.
How to fix invalid rating value on Webflow
  1. Webflow does not inject AggregateRating structured data automatically — it must be added manually via an Embed element or custom code.
  2. Open the product template page in the Webflow Designer (CMS → Products → open the product template).
  3. Locate any HTML Embed element containing JSON-LD structured data. Find the ratingValue field.
  4. Replace any hardcoded value (especially 0) with a CMS-bound dynamic field: click the Embed element, open the field binding picker, and connect ratingValue to a Number field in your Products CMS collection that stores the actual average rating.
  5. Add a conditional visibility rule (using Webflow's Conditional Visibility or a surrounding Collection List) so the entire AggregateRating block is only rendered when the review count field is greater than 0.
  6. Publish the site and test in the Google Rich Results Test.
How to fix invalid rating value on Adobe Commerce (Magento)
  1. AggregateRating structured data in Adobe Commerce / Magento is typically output from the product view template or a dedicated structured data module.
  2. Check app/design/frontend/<Vendor>/<Theme>/Magento_Catalog/templates/product/view/ or the equivalent in the active theme for any structured data template file (often schema.phtml or structured_data.phtml).
  3. If using a third-party SEO extension (Mageplaza SEO, Amasty SEO, etc.), navigate to that extension's configuration in Stores → Configuration → [Extension] → Rich Snippets / Structured Data and confirm ratingValue is mapped to the product's actual average rating attribute, not a default of 0.
  4. In custom code, replace any hardcoded ratingValue with a call to $product->getRatingSummary() or the review model's getReviewsCount() / getRatingSummary() methods, and wrap the block in a conditional that checks review count > 0.
  5. Run bin/magento cache:clean and bin/magento setup:di:compile after making template or module changes.
  6. Validate with the Google Rich Results Test on a product URL that has real reviews.
How to fix invalid rating value on Shopify Plus
  1. Follow the same steps as Shopify above.
  2. For enterprise stores using a custom storefront (Hydrogen/Headless), locate the JSON-LD component in your React/Next.js codebase and apply the same ratingValue bounds fix there.
  3. If using a third-party review platform (Yotpo, Okendo, etc.) at scale, coordinate with the platform's enterprise support to ensure schema output is valid before re-deploying.
How to fix invalid rating value on Yotpo
  1. Yotpo injects its own AggregateRating and Review structured data directly via its widget scripts — the schema output reflects the ratings stored in your Yotpo account.
  2. Log in to Yotpo > Settings > Widgets. Confirm the 'Rich Snippets' or 'SEO' toggle is enabled so Yotpo outputs valid schema.
  3. An invalid ratingValue usually means a product has an averaged score that falls outside the expected range due to data import errors. Go to Reviews > All Reviews and check for any imported reviews with a rating of 0 — edit or remove them.
  4. If you bulk-imported reviews, re-import with corrected rating values (Yotpo supports 1–5 only) via the CSV import tool under Reviews > Import Reviews.
  5. After correcting reviews, purge Yotpo's cache (contact Yotpo support if no self-serve cache flush is available), then validate a product page with the Rich Results Test.
How to fix invalid rating value on Next.js (Headless)
  1. Locate the product page component that renders JSON-LD structured data — typically `app/products/[slug]/page.tsx` (App Router) or `pages/products/[slug].tsx` (Pages Router).
  2. Find the `AggregateRating` object inside your JSON-LD script and identify where `ratingValue` is sourced (e.g. raw API field, CMS field, or a manual constant).
  3. Clamp and sanitise the value before injecting it: parse it as a float, ensure it is a finite number, then clamp it between `bestRating` (max, default 5) and `worstRating` (min, default 1). Never pass `null`, `undefined`, `NaN`, or an out-of-range value.
  4. Ensure `bestRating`, `worstRating`, and `reviewCount` are also present in the `AggregateRating` block — Google requires all four fields for the rating to be valid.
  5. Inject the sanitised object via a `<script type='application/ld+json'>` tag: use Next.js `<Script id='...' type='application/ld+json'>` (from `next/script`) inside the component, or return it from `generateMetadata` / use the App Router's built-in JSON-LD pattern.
  6. Validate the output in Google's Rich Results Test (https://search.google.com/test/rich-results) to confirm the rating is parsed correctly and no warnings remain.

Does your site have this issue?

Run a free SEOLZ scan to find invalid rating value — and every other issue — across your whole site in minutes.

Scan my site free

Frequently asked questions

What is Invalid rating value?

Structured data is hidden code on your product pages that tells search engines facts about your store — things like star ratings, prices, and product names. The `AggregateRating` block specifically communicates your average customer rating. The `ratingValue` field inside that block must be a real number (e.g. 4.3) that falls between the declared minimum and maximum rating values — typically 1 to 5. When it is missing, set to 0, left blank, or formatted incorrectly, search engines consider the entire rating block invalid.

Why does invalid rating value matter?

A valid `AggregateRating` is what earns you gold star snippets in Google Search results — those eye-catching stars visible directly on the results page before a shopper even clicks. Stores with star snippets consistently see higher click-through rates, which drives more organic traffic and sales. An invalid or zero `ratingValue` means Google ignores your rating markup entirely, stripping those stars from your listing and handing the visual advantage to competitors. For Answer Engine Optimisation (AEO), valid rating structured data also influences how AI-powered answer engines and shopping assistants surface and rank your products in direct answers.

How do I fix invalid rating value?

Fix the AggregateRating.ratingValue in your structured data so it is a valid number between 1 and 5 (or your declared scale's minimum and maximum).

Authoritative references

Related Answer Engine Optimization issues