How To Add Rich Snippets for Reviews To Your WordPress Blog

Ads by Google

review snippetsI wrote a few weeks ago about how Google was changing search results dramatically by including more and more semantic information – or what Google likes to refer to as Rich Snippets.

Most recently, this was in the form of recipe meta-data, such as ingredients or cooking time. If you’re running a WordPress blog based around reviews of anything then adding semantic markup is easy.

However, you may find your chosen blog theme is throwing a few errors, so let’s take a look at a suitable plugin and how to deal with some of the errors you might see.

GD StarRatings:

If you do any kind of reviews on your blog, GDStarRatings is an absolute must-have plugin, and I’ve been using it right from the start on my iPad Board Games site to allow readers to rate games they’ve played.

wordpressreview snippets

Ads by Google

This plugin has been around along time and the developers were thoughtful enough to include Rich Snippet markup since last year. Unlike the new Recipe micro-format, the markup and rules for reviews has long been established, so the plugin itself produces well formatted review code without any Google validation errors.

Let’s take a quick look at installing and getting the plugin set up, as it can be a little daunting with all the options available to you. First, let’s download it from within the WordPress interface.

wordpress rich snippet review

After activation, by default the plugin adds a rating block, a thumbs-up bloc, and comment ratings.

rich snippet review

Let’s disable some of those that we don’t need. Expand the new ratings section on your admin sidebar, and click on Settings. Start by disabling the “thumbs-up” ratings by clicking on the green thumbs-up icon next to the word article (check out the screenshot). Deselect all the options for Auto-insert ratings code, and that should remove them.

rich snippet review

I went ahead and did the same for all other auto-inserted ratings blocks except for the main article star rating which is the only one I want.

Testing With Google Rich Snippets Testing Tool:

Head over to the Google rich snippets testing tool here, and enter the URL of one of your reviews.

how to add blog snippets to a website

After running through the testing tool, you may find some more errors as I did, but these will be related to your individual theme rather than the ratings plugin. For instance, on my theme I found that even such simple semantic information such as “entry-title” wasn’t being added. To fix these, you will need to know a little HTML.

Warning: Missing required field “entry-title”.

Warning: Missing required field “updated”.

Warning: Missing required hCard “author”.

Open up the theme folder of your blog, located at wp-content/themes/(name of theme) if you’re going through FTP, or from the WordPress admin screen, expand the Appearance sidebar item and go to Editor.

Open up single.php in your favorite text editor, or just click on the single.php to the left of the editor screen from within WordPress.

First up, Google told us we were missing an entry-title. Hit Find in your browser or editor and look for the_title(). Your can see it’s surrounded by an H2 tag, and in my case with the class=”post_title” applied to it.

how to add blog snippets to a website

We want to add the entry-title class to it too, so in my case I simply added that into the class definition of the H2:

how to add blog snippets to a website

Just below that, Google tells us we are also missing something about when the post was updated. I already have a class=”date” definition, so I simply add “updated” into that one too:

how to add blog snippets to a website

Finally, I’m missing the author information. For now I’ll add it just after the published date. If you already have some code for the_author() somewhere, just surround it with the same span tags as I’ve added below. This tells Google who the author is, their name, and encloses the whole thing in a vcard.

Now, checking the page again I see all the errors have been fixed.

review snippets

As a final step, I’m going to submit my site for Google to start drawing rich snippets from – it won’t necessarily happen automatically, so you need to fill out the form here and Google will consider you for inclusion.

Recipes in WordPress?

There are also a few plugins for adding recipe microformats, however at the time of writing Google had updated their microformat style and neither plugin produced valid results. If you are publishing recipes on your blog, I’d suggest you keep an eye on both hRecipe and RecipeSEO plugins, which I’m sure will be updated soon to reflect the recent format changes.

Conclusion and further reading:

Adding reviews or recipes Rich Snippet data is easy with GDStarRatings, but if your theme isn’t already compatible for the additional author and post meta-data needed, then you may find Google is unwilling to list your site. If you’re getting the same errors as I did, then follow the code tutorial carefully and be sure to make a backup the file in case you make a typo. Next week I’ll begin a series of articles looking in depth at creating a wordpress theme and the structure of themes so you can edit your own a little more, but for now if you’re still getting Rich Snippet errors then feel free to ask a question on the Q&A forum, or post in the comments below, and I’ll do my best to fix them for you.

Affiliate Disclamer

This article may contain affiliate links, which pays us a small compensation if you do decide to make a purchase based on our recommendation. Our judgement is in no way biased, and our recommendations are always based on the merits of the items.

For more details, please read our disclosure.
New comment

Please login to avoid entering captcha

Log In