How to fix invalid rating value on Shopify
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).
Steps for Shopify
- 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).
- 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.
- 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.
- 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.
- 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).
- 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.
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.
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.
See the complete Invalid rating value guide for every platform and the full background.
Not sure if your Shopify store has this?
Run a free SEOLZ scan — we’ll find invalid rating value and every other issue across your whole site.
Scan my site free