I see results in Google search that have stars/user rating. I found plugins to use to allow our users to rate and that rating/stars appears in Google's results. I was wondering if anyone knows a good customizable script (perl, php, etc) that I can use without using a plug in. The script will allow users to rate and ratings will be spidered and displayed in Google's results . Many thanks in advance.
Asked
Active
Viewed 1,403 times
-2
-
1Possible duplicate of [Display an article rating in Google search results](http://stackoverflow.com/questions/7138853/display-an-article-rating-in-google-search-results) – Phiter Dec 26 '15 at 13:26
1 Answers
0
RateIt is what you need. It has a lot of options. Examples are here. I am using it on my several projects. Note that you can only collect ratings with this. Save the rating value in database and then use Schema AggregateRating to show the rating in Google Search results. Also note that adding the rich snippet code never guarantees that your star rating will appear in Google Search and it is up to Google either it shows the rating or not.
Once you save the rating value in database (by doing your own calculations), you can retrieve it and use as below:
<?php
$rating = 3.5; // fetch from database
$users_rated = 20; // fetch from database
?>
<div itemscope itemtype="http://schema.org/Product">
<span itemprop="name">Product Name</span>
<div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
Rating <span itemprop="ratingValue"><?php echo $rating;?></span> / 5 based on <span itemprop="reviewCount"><?php $users_rated;?></span> votes
</div>
</div>

Rehmat
- 4,681
- 3
- 22
- 38