Mark Up A Book Review With Schema.org Microdata

I read a lot and usually write up a review of some kind for what I’ve read, partly as an antidote to shills and partly because I just enjoy doing it. In the interest of sharing the reviews as widely as possible without giving free content to any wealthy corporations, I recently took a little time to revise my WordPress templates, structuring the content using schema.org microdata so that book reviews would stand a better chance of showing up in search results.

Since it took as little bit of time to get right (or what I think is right) I thought I would share the structure and explain things a little. I don’t know yet if this work has boosted my reviews in search results, but I’ll update when I know something.

Here’s the basic structure with irrelevant html stripped out:
[html]
<body itemtype="http://schema.org/Blog" itemscope="" >
<article itemprop="blogPost" itemtype="http://schema.org/Review" itemscope="" >
<div itemtype="http://schema.org/Review" itemscope="" >
<div itemprop="reviewBody">
<img itemprop="image" src="" alt="Image of book cover">
<!– Content of the review goes here. –>
</div>
<!– Sub-scheme identifying the book that was reviewed. –>
<div itemtype="http://schema.org/Book" itemscope="" itemprop="itemReviewed">
<span class="bold" itemprop="name">Book Title</span>
by
<span itemprop="author">Book Author</span><br/>
<span itemprop="publisher">Book Publisher</span>, <meta content="2013-06-01" itemprop="datePublished" />June, 2013
<br/>
<span itemprop="numberOfPages">Number of Pages</span> pages
</div><!– End of Book. –>

<div itemtype="http://schema.org/Rating" itemscope="" itemprop="reviewRating">
<meta content="1" itemprop="worstRating" />
<span itemprop="ratingValue">5</span> / <span itemprop="bestRating">5</span> stars
</div><!– End of Rating. –>
</article><!– End of Review. –>
</body><!– End of Blog. –>
[/html]

What this mark-up describes is something like “This is a blog with a blog post that constitutes a book review, in which this specific book with these properties (author, publisher, and so on) is described so and given this rating.”

The textual content of the review is the WordPress content and the book title and other properties are entered using WordPress custom fields, with some PHP code to extract and display the data from the fields and to render the rating as an array of stars. The project was simple enough that a plugin seemed unnecessary. You can see the mark-up in the wild here.