Studio Builder Elfsight Alternative Build Widget Free →
Technical SEO

Google Reviews Schema Markup: The Complete Implementation Guide for WordPress & Shopify

Published Oct 21, 2026 • 10 min read • By GR Review Strategy Team

What Is Review Schema & Why Rich Snippet Stars Skyrocket Organic Click-Through Rates

If a product or service page shows an average star rating and review count in Google search results instead of a plain blue link, you have a rich snippet — and those stars are pulled from structured data embedded in your site's code. In e-commerce, hospitality, SaaS, and local services, review schema turns ordinary SERPs into click magnets.

Key number: Aggregated research on SERP behaviour suggests rating-rich results outperform plain text listings by roughly 20–35% in click-through rate. A listing that reads "4.8 ★ · 1,240 reviews" captures attention faster than any headline you could write.

The mechanism is simple but powerful. Google parses your JSON-LD (or Microdata) structured data, renders a Review block in the results, and users who see stars are measurably more likely to click. For businesses dependent on third-party traffic, that uplift compounds month over month. Critically, Google does not manually select which sites earn review snippets — it depends entirely on whether your markup is correct, valid, and free of spammy signals.

Google's Strict Structured Data Guidelines for Reviews

Before you add a single line of JSON, it helps to know exactly where Google draws the line between compliant review markup and the markup that earns a manual action. The 2023 self-serving reviews update tightened eligibility rules, making correctness more important than ever.

Schema types Google accepts for reviews

What Google penalises

  1. Markup that does not belong on the page. Embedding AggregateRating on a blog post about reviewing restaurants will trigger validation warnings and can land under the "Spam policies" manual action for misleading markup.
  2. Commercial relationships. Sites that receive payment, commission, or free products in exchange for hosting reviews get flagged automatically, including the "Made from your site" notice.
  3. Inaccurate rating sums. Publishing aggregate data that contradicts the reviews actually visible on the page is treated as misleading, whether the intent is deceptive or merely careless.
  4. Multiple competing schema formats on one page. Mixing Microdata with JSON-LD, or emitting two conflicting AggregateRating blocks, invites invalidation warnings and unpredictable rich result eligibility.
  5. Markup on pages with no review content. A product page with schema but zero visible reviews is one of the most common triggers of the structured-data spam policy.
Quick audit rule: If every review snippet on your site uses the same markup language, the review count matches what's visibly rendered, no compensation is involved, and each schema sits on a page that actually displays reviews — you are almost certainly inside Google's compliance lane.

Complete Copy-Paste JSON-LD Code Examples

Below are production-ready snippets. Paste them verbatim into your theme, plugin output, or storefront templates.

Example 1 — AggregateRating on a product page

{
  "@context": "https://schema.org",
  "@type": "Product",
  "name": "Ergonomic Office Chair",
  "image": "https://cdn.example.com/office-chair.jpg",
  "description": "Mesh-back task chair with adjustable lumbar support.",
  "offers": {
    "@type": "Offer",
    "price": "299.00",
    "priceCurrency": "USD",
    "availability": "https://schema.org/InStock"
  },
  "aggregateRating": {
    "@type": "AggregateRating",
    "ratingValue": "4.7",
    "reviewCount": "328",
    "bestRating": "5",
    "worstRating": "1"
  }
}

For editorial content, the pattern is identical except you swap "@type": "Product" for "BlogPosting" and remove the offers block.

Example 2 — An individual Review item

{
  "@context": "https://schema.org",
  "@type": "Review",
  "author": {
    "@type": "Person",
    "name": "Sarah M.",
    "url": "https://example.com/profiles/sarah-m"
  },
  "datePublished": "2024-02-14T15:30:00Z",
  "itemReviewed": {
    "@type": "Product",
    "name": "Ceramic Coffee Mug, 16 oz"
  },
  "reviewBody": "Durable, microwave safe, and the colour still looks new after six months of daily use.",
  "reviewRating": {
    "@type": "Rating",
    "ratingValue": "5",
    "bestRating": "5"
  },
  "isPartOf": {
    "@type": "Product",
    "name": "Ceramic Coffee Mug, 16 oz"
  }
}

Example 3 — LocalBusiness combined with AggregateRating

{
  "@context": "https://schema.org",
  "@type": "Restaurant",
  "name": "La Maison Trattoria",
  "image": "https://cdn.example.com/trattoria.jpg",
  "url": "https://www.example.com",
  "telephone": "+1-212-555-0142",
  "priceRange": "$$",
  "address": {
    "@type": "PostalAddress",
    "streetAddress": "123 Main Street",
    "addressLocality": "New York",
    "addressRegion": "NY",
    "postalCode": "10001",
    "addressCountry": "US"
  },
  "aggregateRating": {
    "@type": "AggregateRating",
    "ratingValue": "4.5",
    "reviewCount": "542",
    "bestRating": "5",
    "worstRating": "1"
  },
  "geo": {
    "@type": "GeoCoordinates",
    "latitude": 40.7128,
    "longitude": -74.006
  },
  "openingHoursSpecification": [{
    "@type": "OpeningHoursSpecification",
    "dayOfWeek": ["Monday","Tuesday","Wednesday","Thursday","Friday"],
    "opens": "11:00",
    "closes": "22:00"
  }]
}

Keep ratingValue and reviewCount consistent with the visible widget. A mismatch is the number one cause of "invalid review" validation errors, and Google cross-references the two during crawling.

Example 4 — Combined multi-entity graph for a category page

{
  "@context": "https://schema.org",
  "@graph": [
    {
      "@type": "Product",
      "name": "Organic Oat Milk",
      "description": "Unsweetened barista-grade oat milk.",
      "image": "https://cdn.example.com/oat-milk.jpg",
      "offers": {
        "@type": "Offer",
        "price": "3.49",
        "priceCurrency": "USD",
        "availability": "https://schema.org/InStock"
      },
      "aggregateRating": {
        "@type": "AggregateRating",
        "ratingValue": "4.6",
        "reviewCount": "981",
        "bestRating": "5",
        "worstRating": "1"
      }
    },
    {
      "@type": "Organization",
      "name": "Oat Milk Co.",
      "url": "https://www.example.com"
    },
    {
      "@type": "Review",
      "author": {"@type": "Organization", "name": "Oat Milk Co."},
      "datePublished": "2024-03-01",
      "itemReviewed": {"@type": "Product", "name": "Organic Oat Milk"},
      "reviewBody": "Best non-dairy milk we have tried. A touch sweet but perfect at 8 oz.",
      "reviewRating": {"@type": "Rating", "ratingValue": "5", "bestRating": "5"}
    }
  ]
}

Step-by-Step Implementation on WordPress (No Heavy Plugins Required)

Most SEO plugins expose review schema toggles, but agency work and long-term maintenance often favour zero-dependency control. Adding the schema directly through functions.php lets you inject it into wp_head() with a small inline script and no database writes, no shortcodes to remember, and no plugin bloat.

Step 1 — Decide where the data lives

Use a Custom Post Type named product with post meta keys _avg_rating, _review_count, and _review_text. If your ratings come from a review provider, pull them into these fields on save using a lightweight hook or a headless sync, then serve from post meta at render time.

Step 2 — Add the output function to a child theme

function besthelptool_review_schema() {
    if ( ! is_singular( 'product' ) ) {
        return;
    }

    $post_id = get_the_ID();
    $rating  = get_post_meta( $post_id, '_avg_rating', true );
    $count   = (int) get_post_meta( $post_id, '_review_count', true );

    if ( ! $rating || ! $count ) {
        return;
    }

    $data = array(
        '@context'      => 'https://schema.org',
        '@type'         => 'Product',
        'name'          => get_the_title( $post_id ),
        'url'           => get_permalink( $post_id ),
        'aggregateRating' => array(
            '@type'       => 'AggregateRating',
            'ratingValue' => (float) $rating,
            'reviewCount' => $count,
            'bestRating'  => 5,
            'worstRating' => 1,
        ),
    );

    echo '<script type="application/ld+json">'
        . wp_json_encode( $data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE )
        . '</script>';
}
add_action( 'wp_head', 'besthelptool_review_schema', 5 );
Note: wp_json_encode() is the correct way to serialise schema in WordPress. It escapes quotes and unicode safely, and it will not break the JSON if a title contains an apostrophe, an ampersand, or a newline. Avoid hand-built string concatenation — it is the single most common cause of malformed schema.

Step 3 — Scope it to the right pages

Review schema belongs on pages that display reviews: product pages, service pages, local business pages, and genuine review-roundup articles. It does not belong on your homepage, category archives without a real rating, or blog posts that merely discuss reviews. Guard with is_singular() as shown, and add a conditional on the presence of reviews so empty product pages never emit markup.

Step 4 — Verify placement

View page source (not the rendered inspector) and search for application/ld+json. The script should appear once, near the top of <head>, with no HTML comment wrappers. If you use a caching plugin, purge the cache after every change or your new markup will never reach Googlebot.

Step-by-Step Implementation on Shopify with Liquid

Shopify restricts raw <script> tags in theme files, so the schema goes into your theme layout with a conditional guard, or into a specific product template. Both approaches below are live-tested against Shopify's Dawn and Sense themes.

Option A — theme.liquid (site-wide)

Paste inside theme.liquid immediately after the closing </body> tag. Placing it at the end keeps it valid Liquid and survives most page-cache plugins:

{%- if request.page_type == 'product' -%}
  {%- assign meta_rating = product.metafields.reviews.rating.value -%}
  {%- assign meta_count = product.metafields.reviews.count.value -%}
  {%- if meta_rating != blank and meta_count != blank -%}
    <script type="application/ld+json">
    {
      "@context": "https://schema.org",
      "@type": "Product",
      "name": {{ product.title | json }},
      "url": {{ canonical_url | json }},
      "aggregateRating": {
        "@type": "AggregateRating",
        "ratingValue": {{ meta_rating | json }},
        "reviewCount": {{ meta_count | json }},
        "bestRating": "5",
        "worstRating": "1"
      }
    }
    </script>
  {%- endif -%}
{%- endif -%}

Note the | json filter on every output. It is Shopify's Liquid escape hatch for safe JSON encoding and prevents apostrophes in product titles from breaking the script. Never interpolate a raw title without it.

Option B — product template

For theme-wide control, open snippets/product-card.liquid or sections/main-product.liquid and place the block inside your meta tag section, where it will render per-product without a page-type check:

{%- assign r = product.metafields.reviews.rating.value -%}
{%- assign c = product.metafields.reviews.count.value -%}
{%- if r != blank and c != blank -%}
  <script type="application/ld+json">
  {
    "@context": "https://schema.org",
    "@type": "Product",
    "name": {{ product.title | json }},
    "aggregateRating": {
      "@type": "AggregateRating",
      "ratingValue": {{ r | json }},
      "reviewCount": {{ c | json }}
    }
  }
  </script>
{%- endif -%}

Option C — A managed app (GR Review)

Merchants who do not want to touch theme code can use GR Review by BestHelpTool, a native Shopify app that generates the correct AggregateRating and per-review JSON automatically, syncs storefronts to a single dashboard, and supports bulk management across multiple stores. It injects schema server-side, so it does not depend on client-side widget timing — the problem described in the next section.

Testing & Debugging: A Repeatable Workflow

Validate in this order. Skipping step one and going straight to the Rich Results Test is a common habit that produces confusing "no items detected" results.

  1. Schema.org Validator (validator.schema.org) — confirms the schema is well-formed against the vocabulary. This catches missing properties and typos in property names.
  2. Google Rich Results Test (search.google.com/test/rich-results) — run the live URL, not pasted code, so Google tests what your server actually returns. This is the only tool that tells you whether you are eligible for the review snippet.
  3. Google Search Console → Enhancements — the authoritative signal. It shows review status, invalid items, and lets you inspect the exact markup Google parsed on its last crawl.
  4. Structured data monitoring — for WordPress, a scheduled check that re-runs the Rich Results Test monthly catches content drift when a plugin updates and strips your schema.
Warning or Error Root cause Fix
Missing field "@context" Top-level context attribute omitted Always include "@context": "https://schema.org"
Invalid value for aggregateRating ratingValue or reviewCount absent Supply both together, as numbers rather than strings where possible
Multiple competing schemas Microdata and JSON-LD on the same page Pick one format and strip the other from the theme or plugin
Extra review types detected Unrelated reviews mixed with business reviews Separate ProductReview from AggregateRating and nest correctly
Review has no author author property omitted or empty Add author with a Person or Organization object
Rating count mismatch with page Schema count differs from visible review total Generate both numbers from the same source at render time
Debugging habit: Open View Source rather than DevTools. If the JSON is missing from the raw HTML but visible in the inspector, something is injecting it client-side — and Google may never see it. That single check resolves most "schema not detected" tickets.

How Client-Side Review Widgets Interact With Schema

Here is where most implementations quietly fail. A huge share of review widgets — including many top-rated Shopify apps — render their star ratings and review counts via JavaScript after the page loads. Googlebot can and does execute JavaScript, but it does so on a deferred secondary crawl, and it treats late-arriving content with lower priority. The result is inconsistent: markup works for weeks, then disappears, or never renders a review snippet at all.

A review widget that loads after 3 seconds and schema that depends on it is a review snippet that shows up whenever it feels like it. Server-rendered schema wins essentially every time.

Three architectural patterns solve this, in ascending order of robustness:

Frequently Asked Questions

Do I need individual Review entries alongside AggregateRating?

Not always. Google's own guidance treats AggregateRating as the minimum viable implementation for star display, with individual Review items adding depth and topical context but carrying a real page-weight and maintenance cost. For most e-commerce stores, a correct, current AggregateRating plus a handful of representative individual reviews is the pragmatic sweet spot. Add individual reviews when your visible page already displays them.

Will adding review markup hurt my rankings if I do not show real reviews?

The direct risk is low, but the indirect risk is real. Schema on a page with no visible reviews can trip the structured-data spam policy, and the mismatch between what Google renders and what users find undermines trust metrics over time. The safe path is to generate markup only from genuine, authenticated reviews — verified-purchase flows, authenticated user accounts, or a reputable third-party widget — and to filter spam before it reaches your aggregate. Schema should describe the page, never inflate it.

Can I mix JSON-LD with Microdata on the same page?

You can, but you should not. Google recommends JSON-LD because it is isolated from the visible DOM, easier to maintain, and does not interfere with CSS selectors. Mixing formats increases the chance of conflicting values, which produces "multiple competing schemas" errors and can make your page ineligible for the review snippet even though each block is individually valid. Pick one format, apply it consistently, and validate the whole site for leftovers after every theme or plugin update.

How long does it take for review stars to appear in Google?

From implementation to a live review snippet typically takes one to four weeks, depending on crawl frequency and how established the domain is. New or low-authority sites wait longer; well-indexed URLs can update within days. After publishing, run the Rich Results Test to confirm eligibility, ensure your XML sitemap is current, submit the URL in Search Console, and avoid changing the schema or the review counts too frequently — large swings can slow re-evaluation.

Ready to Display Your Google Reviews on Any Website?

Embed verified Google ratings, sliders, and badges in 60 seconds with zero Google Cloud API keys and zero monthly fees.

Generate Free Google Reviews Widget →