How to Add Rich Snippets for Reviews to Your WordPress Blog
I 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.
If you do any kind of reviews on your blog, iPad Board Games site to allow readers to rate games they’ve played.is an absolute must-have plugin, and I’ve been using it right from the start on my
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.
After activation, by default the plugin adds a rating block, a thumbs-up bloc, and comment ratings.
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.
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.
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.
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:
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:
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.
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 RecipeSEO plugins, which I’m sure will be updated soon to reflect the recent format changes.and
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.
- The microformats wiki is a great of technical info
- A Blog Not Unlimited is a more practical tutorial on how to use microformats
- This blog post from 2007 explains a little more about adding microformats to your wordpress, and was invaluable while I was trying to figure this out.
- Look at good HTML coding examples here