What's in this article

      It's great ranking on Google for certain search terms, but what if there was a way you could stand out even more from the competition, with minimum effort?

      There is!  Read this article to find out how to add ratings stars to your search result in Google's Search Engine Results Pages (SERPS).

      It's called a "rich snippet", which is special piece of code that Google reads in your page to learn more about your site and adds to your organic listing.  In this article we are especially interested in one rich snippet, which is called AggregateRating.

      What is AggregateRating?

      AggregateRating is a schema.org rich snippet that Google will read and then place your ratings directly in your search result listing.  The official page telling us about AggregateRating is here.

      If you're not a developer you'll find that page confusing, but you don't need to worry about it.

      What do we need to add ratings in the SERPS?

      So to add ratings to your website in Google's search results, we need two things:

      • Access to the code on your website or ability to add plugins
      • Your reviews added on your site, or ready to add to your site

      Some other things to bear in mind:

      • You cannot add your ratings on your Home page - Don't bother trying it, I did and it doesn't work.  Instead add them on a sub page for a service or product where they can bolster that pages offering.
      • For Wordpress here is an interesting article I found on the subject: https://multiratingpro.com/rich-snippets-ratings-reviews

      How did we do it?

      As you know we are big fans of Concrete5 and that's what Made Simple Media is built in.  Here's how we went about adding the reviews with the ratings rich snippet:

      We built a block

      We built a nice reviews block using Block Designer Pro with a repeatable field so we can add all our reviews with a star rating for each one:

      We built a block

      We obviously had to style this to render out the correct amount of stars and we added Slick slider to turn it into a carousel, but you don't need to do that to show the reviews in the SERPS.

      The critical thing is to dynamically work out the total reviews and the aggregate rating.  Without that weighted average rating, we can't give Google a single rating number to show in the search results.

      So next we loop through our code and add up the number of 5 star reviews, number of 4 star reviews etc to calculate the weighted avergage as per this example

      We also need the total reviews, which is simple using PHP count():

      $reviewCount = count($review_items);
      

      The AggregateRating Rich Snippet

      Here is the final code, complete with our PHP variables for average rating and review count:

      <script type="application/ld+json">
      {
        "@context": "http://schema.org",
        "@type": "Product",
        "name": "Web Design & Development",
        "aggregateRating": {
          "@type": "AggregateRating",
          "ratingValue": "<?php echo $avgRating; ?>",
          "reviewCount": "<?php echo $reviewCount; ?>"
        }
      }
      </script>

      Telling Google to re-index the page

      To get Google to re-index the page and start showing the ratings in the search results, you can go to Search Console (if you set it up with your website) and go to URL Inspection, then add the url you want to in the box that says "Inspect any URL in [website name]:

      Telling Google to re-index the page

      Then on the next page, click "Request Indexing":

      Telling Google to re-index the page

      Conclusion

      Using rich snippets in the organic listings is a great way to really stand out from the crowd and it helps build trust with your visitors because they can see reviews from your customers.

      If you want to add ratings to your website, please get in touch and we can help do that for you.

      Join the discussion

      Want to have your say on this topic? Start by posting your comment below...

      Related Articles

      Keep up to date