How to Review Stars in Search Results for Local Businesses

How to Review Stars in Search Results for Local Businesses 1

Do you ever envy your competitors who have excellent stars in SERPs and other review platforms such as HomeAdvisor, Yelp, and Angie’s List? What if I told you I could teach you how to get such reviews for various website pages from your site without breaking a sweat?

In this guide, I am going to show you how you can create similar search results.

How to Use JSON-LD to Get Aggregated Reviews

JSON-LD has been proven to be very useful in helping local businesses to define additional data. Today, I will teach you how to use this tool to get review stars. However, today, we will refer to the review stars as aggregated reviews.

Check out this sample code below:

<script type=”application/ld+json”>

{ “@context”: “”,

“@type”: “Product”,

“name”: “pdf merger software”,


{“@type”: “AggregateRating”,

“ratingValue”: “4.9”,

“reviewCount”: “7”





This is the code that we added to one of the websites of one of our clients who sell PDF merger software. As you can see from this code, we defined the product, the score, and the number of reviews. However, here are a few additional points that you need to consider to get the best results.

6 Important Facts to Note

Based on multiple experiments, we have uncovered several factors or conditions that have a significant impact on acquiring and keeping the excellent review stars on local search results pages.

The bottom line is, if this process is executed wisely and correctly, the review stars in search results for local business products will influence your site Click Through Rate (CTR) positively.

How to Add the Aggregate Review on Your Site

There are two primary ways of adding aggregated review on your website. The first one is straightforward and works for virtually all content management systems (CMS) while the second one is specifically tailored for sites that run on WordPress.

Implementing Review Stars for Any CMS (Content Management System)

The first thing that you need to note is that almost all content management systems allow one to edit the HTML page or a section of the page. Based on the fact that JSON-LD code is not visible to the website visitors, the search engines will index it as a markup.

Login to your CMS and open the web page that you want to add the aggregated reviews/review stars to and switch to HTML edit mode. Just before </body> part, add the code below:

<script type=”application/ld+json”>{ “@context”: “”,  “@type”: “Product”,  “name”: “##PRODUCT###”,  “aggregateRating”:    {“@type”: “AggregateRating”,     “ratingValue”: “##RATING##”,     “reviewCount”: “##REVIEWS##”    }}</script>


Replace the fields ##REVIEWS##, ##RATING##, ##PRODUCT## with your preferred values and save the page. You are done for that page, amazing right?

Note that, if you are using a caching mechanism, you need first to empty the cache. Doing so will help submit the page to search engines for indexing through Google Search Console as well as reduce the amount of time that it takes for the stars to appear on search engine results pages.

Be patient, we have noticed that for most sites, it takes 3-4 days on average for the stars to appear on SERPs.

Adding Review Stars in WordPress through a Custom Field

Recently, we managed to add the code on one of our client’s website, and the review stars appeared on search engine result pages simply by adding a PHP code in the page template. By doing so, the code is controlled by a custom field that is found within WordPress.

The PHP code that we added to the page is:

<?php if ( ($pagerating = get_post_meta( $post->ID, ‘rating’, true ) )) {    $rating  = explode( “/”, $pagerating );    $score   = $rating[0];    $reviews = $rating[1];    $product = get_the_title();    $ratingoutput = ‘<script type=”application/ld+json”>{“@context”: “”,”@type”: “Product”,”name”: “‘ . $product . ‘”,”aggregateRating”: {“@type”: “AggregateRating”,”ratingValue”: “‘ . $score . ‘”,”reviewCount”: “‘. $reviews . ‘”}}</script>’;    echo $ratingoutput . “n”;  }?>

We went an extra step and specified the rating for each page:

As you can see from the above illustration, the numerical score (ranging from 0-5) should be followed by a slash and the maximum number of reviews to be shown in the search results.

It is also important to note that this PHP code assumes that the page title is the name of the product so you might want to change it to suit your needs.

If you are not conversant with how to add a custom field on a WordPress site, click for more instructions on how to do so.

Ready to Rock and Roll

That’s all that you need to do on your website to get excellent yellow stars on local search engine results pages. Make sure that you follow all the instructions or consult with your local search engine agency to get the expected results. Good Luck!

Exit mobile version