Rich Snippets For Ratings and Reviews In WordPress

richie rich Rich Snippets For Ratings and Reviews In WordPressHave you ever seen the below in a Google Search for a product or a service?

example google rich snippet 300x46 Rich Snippets For Ratings and Reviews In WordPress

Last year Google introduced this feature under the name of Rich Snippets (or structured data). Google will recognize this information when you mark up your  HTML content with one of three formats:  microdatamicroformats, or RDFa.

Once you markup the pages, you can test you Rich Snippets with Google’s handy testing tool. Once implemented, you have no guarantee that your mark up will be included in the index, but you can tell Google here you have made the change or have an interest in Rich Snippets.

So now you have the basic info, how can you get Rich Snippets  for reviews and ratings easily in WordPress? Its really simple and will literally take you five minutes. We first highly recommend you download Lester Chan’s WP-Post Ratings Plugin and follow Lester’s read me file. Please note this solution only works when the plugin is used in a post or page. Once installed, here is how you get your blog Google Rich Snippet ready. You want to add the following found in lines 3-5 to your single.php before the function for ratings found in line 7:

<div class="post" id="post-<?php the_ID(); ?>">
<div class="entry">
<span xmlns:v="http://rdf.data-vocabulary.org/#" typeof="v:Review-aggregate">
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
<span property="v:itemreviewed"><?php the_title(); ?></span></a></h2>
<?php the_content('Read more &raquo;'); ?>
<b>Add Your Rating:</b><?php if(function_exists('the_ratings')){ the_ratings(); } ?>
</div>

The next step is to open the ratings template plugin in options and to copy and paste the below into the template area called “Ratings Vote Text”:

%RATINGS_IMAGES_VOTE% (<span rel="v:rating"><strong><span property="v:count">%RATINGS_USERS%</span></strong> votes, average: <strong><span property="v:average">%RATINGS_AVERAGE%</span></strong> out of %RATINGS_MAX%)<br />%RATINGS_TEXT%</span>

Once all the info is in, modify as you need. Test your deployment with Google’s Rich Snippet testing tool. That’s all it takes. Play around with our code above until its in the format you like. Now all you need to do it  tell Google you have enabled Rich Snippets and hopefully they add your rich content to their search results.

 Rich Snippets For Ratings and Reviews In WordPress

About The Author: Adrian has over 10 years experience in Web Marketing and Analytics. He currently works at Future Electronics in the Web Development Department. In his spare time you can find him tinkering with various open source web projects or reading books on analytics or marketing.

More Posts - Website - Twitter - Google Plus

Print This Post Print This Post
  • Blampy Blam
    Feb 8th, 2011 at 15:40 | #1

    Many thanks for this fascinating article. I will make sure you get the word out about this internet site :) Outstanding publish. Can’t wait to find out the subsequent article.

  • sribharath
    Dec 7th, 2011 at 07:25 | #2

    Thanks it helped a lot , its working in google test tool ..hope it shows up in search as well

Comments are closed.