How do you format keywords in Microdata for a CreativeWork?

Last Rose Studios picture Last Rose Studios · Nov 7, 2011 · Viewed 7.4k times · Source

I'm working with Microdata and I want to use Schema.org’s keywords for CreativeWork.

The schema specifies that it should be text but do I put each keyword in a separate element with itemprop="keywords" or do I put them all in one keywords element? If I put them all in one element do I use commas as a separator?

Answer

unor picture unor · Oct 10, 2015

The definition of Schema.org’s keywords property changed. It now reads:

Keywords or tags used to describe this content. Multiple entries in a keywords list are typically delimited by commas.

So it could look like this in Microdata:

<article itemscope itemtype="http://schema.org/BlogPosting">

  <footer>
    <ul itemprop="keywords">
      <li><a href="/tags/foo" rel="tag">foo</a>,</li>
      <li><a href="/tags/bar" rel="tag">bar</a></li>
    </ul>
  </footer>

</article>

(Example taken from my related answer about semantic markup for tags.)

If you don’t want to have commas visible on the page, you could use a meta element in addition to your normal markup for the tags:

<meta itemprop="keywords" content="foo, bar" />

(It’s allowed to place this meta element in the `body´.)