Search code examples
htmlmarkupstructured-data

typeof vs. itemprop and itemscope


I have always used typeof for structured data. Recently, I found out that we can also use itemprop and itemscope for the exact same purposes.

I know Schema.org is trendy right now but can anyone explain to me why should/should not switch from using typeof to itemprop?


Solution

  • typeof is an attribute from RDFa.
    itemprop and itemscope are attributes from Microdata.

    So your question really is: Should I use Microdata or RDFa?

    Both syntaxes are similar, and both can be used for Schema.org. See my comparison between Microdata and RDFa.

    If you are happy with RDFa, there is no reason to switch to Microdata, unless you know of and care about a consumer (e.g., a search engine) that supports Microdata but not RDFa. The sponsors of Schema.org (Google, Microsoft, Yahoo, Yandex) usually support JSON-LD, Microdata, and RDFa.