[Recipe] shortcode: add additional microformats support (v1 and v2) #4470

chrisaldrich opened this Issue Jul 20, 2016 · 3 comments


None yet

4 participants


Steps to reproduce the issue

The current [recipe] shortcode appears to only support the 'hrecipe' class in microformats1

What I expected

I would have expected the additional dozen or so classes in hrecipe to be supported, or better yet, that it would have also supported the newer microformats2 h-recipe spec in parallel.

I'm anything but a github expert, but I took a crack at adding the additional classes (for both mf1 and mf2) on a forked branch, which also includes some additional detail:

I've got a copy of this patch running on a site with a recipe at: http://boffosocko.com/2016/07/17/chili-prep-for-dinner-tonight/

jeherve commented Jul 21, 2016 edited

We've opted to use Schema.org instead of microformats in other areas of Jetpack. It might be to follow a similar approach for the Recipe shortcode:

Edit: I forgot we already added Schema.org markup to Recipes as well. :)

Do you think we should support both formats? Schema.org is used by search engines like Google, Bing, or Yahoo!, so it seems more relevant to me.

chrisaldrich commented Jul 28, 2016 edited

tl;dr: It's easy enough to support microformats v2 (and even backcompat for v1) and they don't/shouldn't create any conflicts so why not support them out of the box?

I think that a forward-looking platform like Automattic should definitely be supporting (and perhaps even iterating internally) on microformats2, particularly since they're simple added classes that give semantic meaning to the massive amounts of data that are put on the web via the platform. This makes them much more valuable to end users of the web (and doesn't mean they're simply a cut-and-dried SEO tool for Google's benefit.)

Though schema and microformats are meant for the same types of general functionality, their implementations and pros/cons are different. In part, Google controls the schema structure while microformats are more open and extensible, particularly if/when additional classes seem necessary in the wild. Additionally, Google, et al. certainly don't ding sites that use one or the other or even both.

I also know there were a few plugins in the repository that used to support microformats v1 that aren't actively supported anymore (see https://wordpress.org/plugins/hrecipe/ for example with an install base of 600+). Since a plugin really isn't required to add support, putting it into the canonical end-all shortcode for recipes on WordPress is probably the easiest thing for wide-based support.

Kevin Marks does a pretty good job of laying out microformats vs. schema here: http://www.kevinmarks.com/microformatschema.html. Because of the ease of use of microformats2, back in May Kevin was able to build a quick parser to inject mf2 into their site to attempt to save the BBC's Food & Recipe database (http://www.bbc.co.uk/food/recipes/) when they announced they might discontinue it and take it offline. (See: https://twitter.com/kevinmarks/status/732586363128664064; https://twitter.com/kevinmarks/status/733115448410116097)

Amy Guy, part of the W3C Team and co-staff contact for the Social Web working group, also has some useful thoughts on the benefits of microformats (and comparison with linked data) as well: http://rhiaro.co.uk/2015/08/extensibility

I'm doing some parsing related work on my suggested (pending) pull request to make sure that parsers will properly read the recipe data. It may require a tweak or two prior to pulling.

Additional References:

@kraftbj kraftbj added this to the Community milestone Jul 28, 2016
kraftbj commented Jul 28, 2016

@chrisaldrich That all makes sense to me. I don't see a downside to doing both. I can't say if/when we'd get to it since it isn't high-priority, but I'd support inclusion of a PR on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment