Get star ratings in Google search results. Here's how review schema works and how to add it.


You've seen it in Google search results - a listing with golden stars and a rating like "4.8 based on 47 reviews." Those stars aren't random. They come from review schema markup embedded in the website's code.

Adding review schema to your testimonial pages can increase your click-through rate from search results significantly. Here's how it works and how to implement it.

What Is Review Schema?

Schema markup is structured data you add to your HTML that helps search engines understand your content. Review schema specifically tells Google: "This page contains reviews. Here are the ratings, authors, and review text."

When Google processes this schema, it may display rich snippets - star ratings, review counts, and aggregate ratings - directly in search results.

Does It Actually Help?

Rich snippets with star ratings stand out visually in search results. Pages with rich snippets tend to get higher click-through rates because the stars draw attention.

However, Google doesn't guarantee they'll display rich snippets for every page with schema. They're more likely to appear for:

  • Product pages with multiple reviews
  • Local business pages
  • Pages where the reviews are clearly from real customers about a specific business/product

Google is less likely to show review stars for self-serving testimonial pages where a business only displays positive reviews it selected. Be aware of this nuance.

Basic Review Schema (JSON-LD)

The most common approach is JSON-LD, which you add to the <head> or <body> of your page:

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "LocalBusiness",
  "name": "Your Business Name",
  "url": "https://yourdomain.com",
  "aggregateRating": {
    "@type": "AggregateRating",
    "ratingValue": "4.9",
    "reviewCount": "47",
    "bestRating": "5",
    "worstRating": "1"
  }
}
</script>

Replace LocalBusiness with the appropriate type for your business: ProfessionalService, Product, Course, SoftwareApplication, etc.

Adding Individual Reviews

For more detailed schema that includes individual reviews:

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "ProfessionalService",
  "name": "Your Business Name",
  "aggregateRating": {
    "@type": "AggregateRating",
    "ratingValue": "4.9",
    "reviewCount": "3"
  },
  "review": [
    {
      "@type": "Review",
      "author": { "@type": "Person", "name": "Jane Smith" },
      "reviewRating": { "@type": "Rating", "ratingValue": "5" },
      "reviewBody": "Excellent work. Delivered on time and exceeded expectations."
    },
    {
      "@type": "Review",
      "author": { "@type": "Person", "name": "Bob Johnson" },
      "reviewRating": { "@type": "Rating", "ratingValue": "5" },
      "reviewBody": "The best investment we made this year."
    }
  ]
}
</script>

Where to Add Schema

Add review schema to pages where you display testimonials:

  • Your Wall of Love or dedicated testimonials page
  • Service pages with relevant testimonials
  • Your homepage if it includes a testimonial section

Don't add schema to pages without visible reviews. Google requires that the reviews in the schema match reviews visible on the page.

Google's Guidelines

Google has specific rules about review schema:

Do: Use real reviews from real customers. Match the schema data to visible reviews on the page. Use aggregate ratings that reflect the actual average.

Don't: Make up reviews or ratings. Add schema to pages without visible reviews. Use review schema for self-promotional content that isn't from actual customers.

Violating these guidelines can result in a manual penalty - Google removes your rich snippets entirely.

Testing Your Schema

After adding schema, validate it:

  1. Go to Google's Rich Results Test: https://search.google.com/test/rich-results
  2. Enter your page URL
  3. Check for errors or warnings
  4. Fix any issues

Also use Google's Schema Markup Validator for more detailed validation.

Dynamic Schema from Your Widget

If you're using a testimonial widget (like Quoted), the reviews are loaded dynamically via JavaScript. Google may or may not index JavaScript-rendered content.

For best results, add the schema markup server-side (in your Rails/PHP/Node code) so it's present in the initial HTML. Your backend knows the approved testimonials and their ratings - generate the JSON-LD from that data.

For example, in Rails:

# In your controller or helper
def review_schema_json(project)
  testimonials = project.testimonials.approved.limit(10)
  avg_rating = testimonials.average(:rating)&.round(1)

  {
    "@context": "https://schema.org",
    "@type": "ProfessionalService",
    "name": project.name,
    "aggregateRating": {
      "@type": "AggregateRating",
      "ratingValue": avg_rating,
      "reviewCount": testimonials.count
    }
  }.to_json
end

Then in your view:

<script type="application/ld+json"><%= raw review_schema_json(@project) %></script>

The Realistic Expectation

Adding review schema doesn't guarantee star ratings in search results. Google decides whether to show them based on many factors. But having correct schema markup gives you the best possible chance.

Even without visible stars, schema helps Google understand your content better - which can indirectly improve your search rankings.


Collect reviews with built-in star ratings →

Ready to try Quoted?

All features free during early access. No credit card, no limits.

Start Collecting - It's Free