How to add aggregated review stars in Google search results and boost your site’s credibility and visibility in the SERPs
Structuring your data using schema.org to show star ratings in Google is a great and simple tactic to give your website more prominence in the search engine result pages (SERPs)
Note: As of 16th September 2019 this tactic won’t work any more for reviews that are deemed self-serving, e.g. a review about entity A on entity A’s own website. More information can be found on the official Google blog.
There are services out there, such as Feefo, CheckATrade and RatedPeople that will automate the process of gathering reviews from real customers for you.
The disadvantage of using a review collection service is that they cost you money and your website won’t benefit from star ratings in Google, only theirs.
The possible advantage is that Google may use the data from third party review sites as a ranking signal of your websites credibility.
There are some schema.org generators out there that will allow you to easily generate the necessary code to add to your site.
I prefer a more dynamic method by utilising Advanced Custom Fields (ACF) in WordPress along with a custom post type (CPT) to allow a client to easily add reviews to their site, then code up the templates to automatically generate the code.
Some notes on adding star ratings to your website:
- Stars in the SERPs won’t work on your homepage, only sub-pages.
- You’ll need actual reviews, not made up ones, as per the Google search gallery technical guidelines for review snippets
- You’ll need at least some technical understanding of adding code to your website
- Your reviews need to be visible on your website (otherwise it’ll come across as spammy) this goes for each individual review as well as the Aggregate Rating
Contents
- What's the benefit from adding star ratings to my website?
- What's the best way of collecting real reviews from customers?
- How to add a review CPT in WordPress?
- What custom fields do I need to add?
- What code do I need to structure my review data?
- How can I test that my structured review markup is correct?
- How long does it take for review stars to show up in Google?
- What will the stars look like when they show in Google?
- Will my star ratings also show up in Bing?
- Will star ratings show up only on the first result page on Google?
- Will star ratings boost my rankings on Google?
- What else can I do with Structured Data schema.org markup?
1. What's the benefit from adding star ratings to my website?
The primary benefit in adding star ratings to your website is to make your result in Google stand out from the rest.
This hopefully means your result will get higher click through rates than your competitors in the SERPs.
2. What's the best way of collecting real reviews from customers?
This is probably the hardest part of the whole process - to actually collect real reviews and ratings from real customers.
If you are a digital business, e.g. you don't come face-to-face with your customers, one option is to send a pro-forma email asking for a review and rating on your service.
If you are a land-based business, such as a hotel, shop or restaurant for example, you could provide a customer with a postcard sized feedback form for customers to fill out when they leave or even direct them to an on-line client rating form on your website where you can later moderate the review.
3. How to add a review CPT in WordPress?
The first step, assuming you are using ACF and WordPress for this, is to add a custom post type with custom fields for your customer reviews.
Below is example code to add to functions.php for the CPT
function cpt_clients() { $labels = array( 'name' => _x( 'Testimonials', 'post type general name' ), 'singular_name' => _x( 'Testimonial', 'post type singular name' ), 'add_new' => _x( 'Add New', 'canvas' ), 'add_new_item' => __( 'Add New Testimonial' ), 'edit_item' => __( 'Edit Testimonial' ), 'new_item' => __( 'New Testimonial' ), 'all_items' => __( 'All Testimonial' ), 'view_item' => __( 'View Testimonial' ), 'search_items' => __( 'Search Testimonial' ), 'not_found' => __( 'No Testimonials found' ), 'not_found_in_trash' => __( 'No Testimonials found in the Trash' ), 'parent_item_colon' => '', 'menu_name' => 'Testimonials' ); $args = array( 'labels' => $labels, 'description' => 'Holds our Testimonials', 'public' => true, 'menu_position' => 5, 'supports' => array( 'title', 'editor', 'page-attributes', 'thumbnail'), 'has_archive' => false, 'menu_icon' => 'dashicons-format-quote', 'rewrite' => array('slug' => 'client-feedback', 'with_front' => FALSE) ); register_post_type( 'client-feedback', $args ); } add_action( 'init', 'cpt_clients' );
There are a few tweaks you can make to the in-built WordPress function register_post_type - have a read through the WordPress register_post_type function reference for more information.
4. What custom fields do I need to add?
All we really need for our customer reviews area in wp-admin is a field for adding a number, in my example, out of 5 and a 'Name' text field.
Go to Advanced Custom Fields > Add New. Call the field group 'Reviews' and add a number field called 'Star Rating' and a text field called 'Name'.
In the field location option select your custom post type created above from the dropdown.
Now go to your post type in wp-admin and start adding your reviews.
5. What code do I need to structure my review data?
This is the nitty gritty of this FAQ, the actual schema.org review code to add to your template files.
There are to bits of code we need to add;
1. schema.org for each individual review
2. schema.org for an AggregateRating
For each individual review, here is a schema.org example in JSON-LD review markup (which Google recommends over MicroData). Replace the reviewRating value with your rating field and the author > name value with your name field.
If you are familiar with the WordPress template hierarchy, you can add this code within the loop to single-client-feedback.php (if you have chosen to show single review posts) and archive-client-feedback.php for your custom post type archive.
<script type=application/ld+json>{ "@context": "https://schema.org/", "@type": "Review", "itemReviewed": { "@type": "Organization", "image": "https://www.tring-web-design.co.uk/wp-content/uploads/2015/12/facebook-card-image.jpg", "name": "Tring Web Design", "telephone": "01442800500", "address" :{ "@type": "PostalAddress", "streetAddress": "8 Station Road", "addressLocality": "Tring", "addressRegion": "Hertfordshire", "postalCode": "HP23 4QS", "addressCountry": "GB" } }, "reviewRating": { "@type": "Rating", "ratingValue": "5" }, "name": "Over and above what I expected", "author": { "@type": "Person", "name": "Helena" }, "reviewBody": "<p>I can’t thank you enough Oliver for your help with the technical issues I had with my website. Not only did you surprise me with your speedy response to my initial inquiry (within the hour!), you then provided me with really comprehensive advice, solutions, and tips. You went over and above what I expected, thank you. I wouldn’t hesitate to recommend you. </p> ", "publisher": { "@type": "Organization", "name": "" } }</script>
You will also want to make each review visible on your template pages (e.g. don't hide the reviews from Google crawler!).
For the AggregateRating JSON-LD code, which is the most important part of this FAQ for adding review stars to your Google results, is below. The PHP code collects our total ratings which we can then add to the JSON-LD AggregateRating code underneath.
The PHP code:
'clients', 'posts_per_page' => -1); $loop = new WP_Query( $args ); $stars = 0; $count = 0; while ( $loop->have_posts() ) : $loop->the_post(); AggregateRating $get_stars = ''; $get_stars = get_field( 'rating' ); $stars += $get_stars; $count++; endwhile; wp_reset_query(); $total_rating = $stars/$count; ?>
The JSON-LD code:
<script type=application/ld+json>{ "@context": "https://schema.org/", "@type": "LocalBusiness", "name": "Tring Web Design", "image": "https://www.tring-web-design.co.uk/wp-content/uploads/2015/12/facebook-card-image.jpg", "address": "8 Station Road, Tring, Hertfordshire, HP23 4QS, GB", "telephone": "01442 800 500", "priceRange": "£££", "aggregateRating": { "@type": "AggregateRating", "ratingValue": "<?php echo round($total_rating, 2); ?>", "bestRating": "5", "ratingCount": "<?php echo $count; ?>" } }</script?>
You will also need to make your AggregateRating visible in your template file, I generally place them in the footer.php somewhere.
6. How can I test that my structured review markup is correct?
Now that you have the Review & AggregateRating JSON-LD code in place and have populated your testimonials with real reviews from your customers, you can test your implementation by using the Structured Data Testing Tool from Google.
It will highlight any errors you may have in your code allowing you to fix your code.
7. How long does it take for review stars to show up in Google?
It may take a few weeks for Google to re-index your pages and show the review stars under your website in the SERPs.
You can re-submit your URL in the Google Search Console (GSC) for re-indexing to try and speed up the process. To do this go to your site in GSC, click 'URL Inspection' in the left menu, paste in your URL and click 'Request indexing'.
8. What will the stars look like when they show in Google?
Below is a screen shot of my site and how it looks in Google with star ratings. As you can see the homepage doesn't have the star ratings underneath. This is simply how Google works in displaying stars and not a reflection of your site in anyway.
9. Will my star ratings also show up in Bing?
Yes they will, you can see this in the image below showing star ratings on my search result in Bing.com.
Note: If you aren't adding your site(s) to Bing Webmaster Tools, you should be. Whilst the Microsoft owned search engine only has around 4% of the search engine market, it's still worth adding your site to Bing and submitting your XML sitemap.
10. Will star ratings show up only on the first result page on Google?
Some forms of structured data will only display in Google search result pages if that result is on page one of the results (FAQPage for example).
Star ratings however will display under your Google search results on whatever page they are on.
11. Will star ratings boost my rankings on Google?
I've not seen any direct evidence to show that adding star ratings to your website as structured data will have a positive effect on your website rankings.
However, there are indirect ranking factors that may result from adding star ratings to your website, such as getting more click through rates.
The main benefit to adding stars is to make your website stand out fro your competitors in the search engine result pages.
12. What else can I do with Structured Data schema.org markup?
There are other types of website data that you can markup using schema.org that Google will recognise and display differently in it's SERPs.
These other types of data are listed in the Google Search Gallery. I've found FAQPage particularly effective in not only changing the appearance of my SERPs but also in boosting the rankings of specific pages to the extent of getting on the first page of Google.