Why Google won’t generate rich snippets
It seems that many (most?) WordPress themes ship with broken micro-formatting in their templates. Normally this is not a problem, until you check your recipe posts with Google’s Rich Snippet Test Tool. Then you’ll find that the invalid micro-formatting prevents Google from generating a rich snippet preview. Typically, you’ll see something like this:
See those red warnings? They are enough to stop Google from generating your recipe snippet.
How can I fix it
Although the errors are nothing to do with EasyRecipe, it’s such a common problem we’ve provided an option that should fix it in most cases. The solution is to check the ”Remove broken microformatting” option in the “General Settings” tab on the EasyRecipe Settings page.
Is it safe to do this?
Mostly safe. The way we’re forced to do this is a bit of a hack and certainly less than ideal. We figure it will be probably be safe for 99% of sites, but we can’t guarantee that – that’s why it’s optional in EasyRecipe. If it does mess with your site it will most likely make the formatting go awry in some cases. Fortunately it’s not a problem with most themes we’ve seen.
Is there a better way
Yes. The ideal solution would be if theme developers fixed their themes! Failing that, you could edit the theme files yourself and remove the offending code. While we can’t give you specific instructions because every theme is different, what you need to do is remove the CSS classes hfeed, hentry and vcard from wherever they appear in your theme’s template files.
How can I check all my recipes easily
You can run a site-wide snippet test by using our free snippet test plugin, EasySnippet
The techie details
There are several markup schemes that Google recognizes when it comes to Rich Snippets. The two we’re interested in are micro-formatting and microdata. EasyRecipe uses the schema.org microdata scheme not only because it’s more flexible and allows for more data to be specified, but it’s what Google recommends and if that’s how Google wants it, we figure we’d be wise to provide it that way!
The problem arises when Google sees invalid micro-formatting on a page, followed by valid microdata. For reasons best known to the Google gurus, it will ignore the perfectly valid microdata.
WordPress by default adds the hentry CSS class to every post, which signifies the start of a micro-formatted hatom feed. Unfortunately most themes don’t go on to provide the remaining required markup that will make the hatom feed valid and that’s usually what trips up Google’s rich snippet generator. Some themes are even worse and explicitly add incomplete micro-formatting markup to each comment.