Do you put Schema Microdata meta tags in the html body?

If a meta element

  • has an itemprop attribute and a content attribute, and
  • has no name attribute, no http-equiv attribute, and no charset attribute,

then it’s valid to have this meta in the body. (If the value is a URL, you must use link instead.)

Why? Because the Microdata specification changes HTML5.

(Note that RDFa also changes HTML5 by allowing meta in the body in some cases.)


If you were to keep the meta tags in the <head>, then how would you relate these two dates to their reviews?

You could use the itemref attribute:

<!DOCTYPE html>
<html>
<head>
  <title>Using itemref for meta in the head</title>
  <meta itemprop="datePublished" content="2011-03-25" id="date">
</head>
<body>

  <div itemscope itemtype="http://schema.org/Review" itemref="date">
    <span itemprop="name">…</span>
  </div>

</body>
</html>

itemref takes a space-separated list of id values, so you can even reference two or more elements. Just add the id of all elements (containing itemprop attributes) that should be added to the item to its itemref attribute, e.g.: itemref="date author rating".

Leave a Comment