# How to get star ratings in Google search results

> What Google needs to show your products' star ratings in search, why stars sometimes don't appear, how to check your rating markup, and what Reytd adds for you.

Google can show a product's star rating and number of reviews under it in search results. Those stars catch the eye before a shopper has even clicked. Google takes them from rating markup on the product's page: structured data that says what the product is and how your customers rated it. Reytd's reviews widget adds it for you, into the product markup your theme already has.

_Figure: A Google search result for Everyday Glass Bottle on example-store.com, with four and a half stars, Rating: 4.6 and 128 reviews under the title. The rating comes from the markup's ratingValue, the number of reviews from reviewCount, and the title from the product's name._

The stars, the rating and the number of reviews all come from the page's `AggregateRating`; Google decides whether to show them.

## What Google needs

Google's [review snippet guidelines](https://developers.google.com/search/docs/appearance/structured-data/review-snippet) and its [product snippet docs](https://developers.google.com/search/docs/appearance/structured-data/product-snippet) set these rules:

- **A product's own page.** The markup describes one product (or the variants of one product), on a page about that product, not a category page or a list of products.
- **The reviews are on the page.** It must be obvious to shoppers that the page has reviews, and they must be able to see the reviews and the rating the markup describes.
- **Not copied from other websites.** The rating comes from reviews on your site, not from reviews or ratings gathered elsewhere.
- **No undisclosed rewards.** Google doesn't want fake reviews, or reviews someone was rewarded for without saying so. Reytd never rewards reviews; if your store does, say so.
- **Products, not your store.** A business's reviews of itself don't get stars, so reviews of your store on your front page get none, even with markup. Reytd's store carousel adds none for that reason.

Our advice on top: give each product one rating in its page's markup, from your own customers' reviews. Two different ratings, say from your theme and from an app, leave it unclear which one counts.

Even then, Google decides whether to show stars and never promises them.

## What Reytd adds

Reytd is careful not to give Google a second product or a second rating. On a page with a product's [reviews widget](https://reytd.com/docs/widgets/reviews.md), the widget first reads the product markup your theme already has, then:

- **Your theme has a `Product`:** the widget adds the rating to it, so your page describes one product with both your price and your rating. Nothing to set up.
- **Your page has no `Product`:** the widget adds one of its own, with the product's name, and its SKU and image when Reytd has them.
- **It can't add to yours:** it adds nothing rather than a duplicate (unless it can't tell whether your page's `Product` is this product), and the **Widgets** page in Reytd tells you why. See [When Reytd can't add its rating](#when-reytd-cant-add-its-rating).

What it adds is the same either way:

- an `AggregateRating` with the average rating and the number of reviews;
- up to 5 of the product's reviews with a name, the first in the widget's order, each with its rating, author and date, as written (never a translation). A review posted anonymously still counts in the rating, but stays out of this list: Google wants each review's author to be a name.

It adds markup only for a product with reviews, and only on a page about one product: a page with several products' reviews widgets, like a landing page, gets none. Google reads markup added by JavaScript when it renders the page.

The markup is a setting on the **Widgets** page in Reytd: **Add rating markup for Google's stars**. It's on unless you turn it off.

## If your theme has its own product markup

Many store themes already add a `Product` to each product page, with its price and stock. A second `Product` for the same item, with the rating, would be ambiguous, and Google might pick either one. That's why Reytd adds its rating to your theme's `Product` instead.

_Figure: Two markups on one page: the theme's Product with the price, and a second Product with the rating. Google may see two products._

_Figure: One markup: the theme's Product with both the price and the rating, which Reytd's widget adds to it._

How it adds the rating depends on your theme's markup:

- **With an `@id`** (WooCommerce's, for example: the product's address and `#product`), Reytd adds a small block of its own with the same `@id`, which is how structured data says two blocks describe the same product. Your theme's markup stays as it is. Check the result in the [Rich Results Test](#check-your-markup): it should show one product with both your price and the rating.
- **Without one,** Reytd writes the rating into your theme's markup on the page.

On WooCommerce, the [Reytd plugin](https://reytd.com/docs/integrations/woocommerce.md) also takes WooCommerce's own rating out of its markup while Reytd's reviews replace WooCommerce's, so WooCommerce's hidden rating never competes with Reytd's. A rating added by an SEO plugin, such as Yoast or Rank Math, stays: turn it off there.

### Adding the rating on your server instead

If you'd rather have the rating in the page's HTML from the start, add it to your theme's `Product` yourself, and Reytd adds nothing (a `Product` that has a rating is left alone):

1. Read the product's rating from the API, on your server: `GET /v1/products?filter[external_id]=10001` answers with `rating.average` and `rating.count` (an API token with `products:read`, on every plan). For a product in a product group, use `group.rating` instead, the rating its reviews widget shows (see [Product groups](#product-groups)).
   Keep a copy, and read every product's rating again on a schedule, for example once a day: a new review changes a product's rating but not its `updated_at`, so `filter[updated_since]` doesn't find it. Never call the API from the browser, where anyone could read the token.
2. Add it to the `Product` your theme writes, only when the product has reviews (`count` above 0):

```json
"aggregateRating": {
    "@type": "AggregateRating",
    "ratingValue": 4.6,
    "reviewCount": 128
}
```

That way the rating doesn't depend on JavaScript: Google's docs warn that markup added by JavaScript can make its Shopping crawls less frequent and less reliable. Keep the reviews widget on the page, so shoppers see the reviews the rating comes from. Then the Widgets page shows that Reytd didn't add its rating because your theme already has one, which is what you want, and you can turn Reytd's markup off.

## When Reytd can't add its rating

When the reviews widget can't add its rating to your theme's markup on a product page, it tells Reytd why: it adds nothing at all, or, when it can't tell which product your page's markup is about, its own `Product`. The **Widgets** page then shows a notice for each reason, with a few of the products, while the markup setting is on, for 7 days after it last happened. Check one of those pages in the [Rich Results Test](#check-your-markup), then fix it as below.

### Your theme already adds a rating

Your page's `Product` already has a rating. Two ratings for one product leave it unclear which one counts, so Reytd adds none. Where it comes from:

- **Another reviews app,** perhaps one you used before Reytd: turn its markup off, or remove the app.
- **Your platform's own reviews:** turn them off, so their rating leaves your markup. On WooCommerce, the Reytd plugin does it for you while **Show Reytd's reviews and stars in place of WooCommerce's own** is on.
- **One you add from Reytd's API** (see [Adding the rating on your server instead](#adding-the-rating-on-your-server-instead)): keep it. There's nothing to fix, and you can turn Reytd's markup off.

### Your theme uses microdata

Your theme describes the product with microdata (`itemscope` and `itemprop` in the page's HTML), or RDFa, rather than JSON-LD. Reytd doesn't write into a theme's HTML, so it adds nothing rather than a second product. Move your product markup to JSON-LD (many themes and SEO plugins have a setting for it), or add the rating to your microdata from the API, as in [Adding the rating on your server instead](#adding-the-rating-on-your-server-instead).

### Your page has several products

Your page's markup has a `Product` that Reytd couldn't tell is this product: more than one, say the product itself and some related products, or a single one with another product's address or SKU, like a featured product. Then Reytd adds its own `Product`, so this page may have two. Give the page's own product one of these, as Reytd knows it:

- a `url` or `@id` with the product's address, the page you're on;
- or its SKU, as `sku`.

### Set up your markup so Reytd can add to it

For developers and headless shops: a `Product` like this one, with an `@id`, its address and its SKU, and no rating. Reytd's widget adds the rating to it.

```json
{
    "@context": "https://schema.org",
    "@type": "Product",
    "@id": "https://example.com/products/everyday-glass-bottle#product",
    "url": "https://example.com/products/everyday-glass-bottle",
    "name": "Everyday Glass Bottle",
    "sku": "EGB-500",
    "offers": {
        "@type": "Offer",
        "price": "24.00",
        "priceCurrency": "EUR",
        "availability": "https://schema.org/InStock"
    }
}
```

A shop that draws its pages in the browser can write or change this markup any time: the widget sees it, and adds the rating to the new markup.

## Product groups

When variants share their reviews as a product group (on plans with product groups), each variant's reviews widget shows the whole group's reviews, and its markup carries the group's rating with that variant's name, SKU and image. Through the API, that rating is `group.rating`, so a theme that adds the rating itself uses it for every variant. A reviews widget for the whole group (`data-group`) marks up the group by its name, without a SKU or image.

## Check your markup

Open Google's [Rich Results Test](https://search.google.com/test/rich-results) with the address of one of your product pages, not pasted code: pasted code can't load the widget's reviews, so it finds no rating. It should find the product once, with your price and the review data: as a **Product snippet**, and on a page where shoppers can buy it, usually as a **Merchant listing** too. (A `Product` Reytd adds itself has no price, so it can only be a Product snippet.)

_Figure: Google's Rich Results Test with a product page's address entered. The result: page is eligible for rich results, with one valid Product snippets item, showing its name and its aggregateRating: rating 4.6 from 128 reviews._

Test the page's address, so the widget can load its reviews, then open the Product snippets (or Merchant listings) item.

- **Two products, or two ratings:** check the **Widgets** page in Reytd for a notice saying why, and see [When Reytd can't add its rating](#when-reytd-cant-add-its-rating).
- **Nothing found:** the page needs the reviews widget, and the product needs at least one published review.

For your whole store, Google Search Console's **Product snippets** and **Merchant listings** reports list the pages Google found markup on, and any problems. They fill in as Google crawls your pages, over days or weeks.

## Why stars don't show

Work down the list:

1. **Too soon.** Google has to crawl and index the page again first, which can take several days, sometimes longer. **Request indexing** in URL Inspection (below) can speed it up, without a promise.
2. **Not indexed.** In Google Search Console, the **URL Inspection** tool shows whether the page is indexed and how Google sees it. If it isn't indexed, Google can't show stars for it yet.
3. **No markup on the page.** The Rich Results Test finds none: the page has no reviews widget, the product has no published reviews yet, the markup is turned off, or your theme uses microdata (see [Your theme uses microdata](#your-theme-uses-microdata)).
4. **Two ratings, or the price and the rating in two products.** See [When Reytd can't add its rating](#when-reytd-cant-add-its-rating).
5. **Not a product page.** Category pages and the front page don't get product stars.
6. **Google chose not to.** The markup is right and the page indexed, but Google doesn't show stars for every page, and doesn't say why. Keep collecting reviews and check again in a few weeks.

## Next

- [Reviews widget](https://reytd.com/docs/widgets/reviews.md): the widget that shows the reviews and adds the markup.
- [Custom and headless stores](https://reytd.com/docs/integrations/custom-store.md): send your orders, so review requests go out and your products collect reviews to mark up.
- [API reference](https://reytd.com/docs/api.json): `GET /v1/products` and its fields.
