Are Microformats Right for Your Site?

Adding structured data to your site doesn't need to be complicated or difficult. It can be as simple as adding a handful of attributes to your page -- "'class"and "rel" are the most common. Many sites use semantic markup, and already have these attributes, in which case you can insert additional values into existing attributes, since these actually hold space-separated lists. Microformats is the name of one common method for using this kind of simple markup.

Microformats are community-driven standards, put together and maintained by volunteers outside of a formal organization like IETF. Typically, they cover well-worn use cases, a concept called "paving the cowpaths." A number of microformat specifications in various stages of development are available at microformats headquarters.

Initially, the Yahoo! Search indexer supports the following microformats:

* hCard for personal or organization contact info
* hCalendar for event descriptions and timelines
* hAtom for syndicated content as might appear in an RSS feed
* hReview to record review ratings such as "8.5 out of 10"
* XFN to track relationships on the social graph in a lightweight fashion

The Web has a huge number of helpful articles and tutorials on using microformats. If the structured data your site exposes falls into any of categories above, then microformats are probably a good choice for you.

Here's a simple example. If your personal site already has markup like this, pointing to one of your other sites:
<a href="">My site</a>

Add XFN with a single attribute, like this:
<a rel="me" href="">My site</a>

The value of rel="me" indicates that the other site is also representative of you.

A more involved example requires changes across more than one element. Let's say a page mentions a review of an iPod, like this:
<div>Overall, I give the iPod a rating of 8 (out of 10)</div>

To add hReview markup to this, a few additional wrapper elements are needed, like this:

<div class="hreview">
   Overall, I give the
   <span class="item">
      <span class="fn">iPod</span>
   a rating of
   <span class="rating">
   (out of
   <span class="best">

This is simplified markup. Consult the site for specific details. In general, these changes indicate that the overall structure is a review ("hReview"), that the item being reviewed is an iPod (additional details such as a URL are helpful), and the rating is 8 out of a possible 10.

What if your structured markup needs go beyond the list of supported microformats? Please provide us with feedback, as we are continuously evaluating and adding support for additional microformats. On the other hand, you might want to consider using more expressive RDF markup. If you want to expose structured data but aren't ready (or able) to make site changes yet, then you might consider writing a custom data service. Stay tuned, we'll cover these topics in future blog posts.

By the way, we'll be talking about microformats among other things later today (Thursday, May 15) at the SearchMonkey Launch Party at Yahoo!'s Sunnyvale headquarters. Here are the details – join us for a bit of SearchMonkey talk and a plenty of beer, food, and schwag.

Micah Dubinko
SearchMonkey Team Alumnus