The HTML itemtype attribute
The HTML itemtype attribute specifies the vocabulary URL (usually a schema.org type such as https://schema.org/Product) that defines the available properties of a microdata item. Use it on the same element as itemscope.
Overview
The itemtype attribute names the vocabulary that describes a microdata item. It is set on the element that carries itemscope, and its value is an absolute URL, almost always a schema.org type like https://schema.org/Recipe or https://schema.org/Product.
Once the type is set, the itemprop names you use inside the item should match the properties that type defines, so search engines can interpret them correctly.
Syntax
<div itemscope itemtype="https://schema.org/Product"> … </div>
Values
| Value |
|---|
| A valid URL identifying the vocabulary (e.g. https://schema.org/Product). |
Example
<div itemscope itemtype="https://schema.org/Person">
<span itemprop="name">Ada Lovelace</span>
</div>
Best practices
- An
itemtypecan hold several space-separated types, such as two schema.org types, as long as they all come from one vocabulary. Types from two different vocabularies in one itemtype aren't allowed. - A nested item that is a different kind of thing, such as a Person inside a Book, needs its own itemtype. Without one, its property names are read against the outer item's types.
- Copy each type URL exactly as the vocabulary writes it. Item types are opaque identifiers, and user agents must not take an unknown one apart to guess how to process it, so they can't map an altered spelling back to the type you meant.
- For a property the type doesn't define, use a full absolute URL as the itemprop name, such as
itemprop="https://example.com/color", rather than a short word. - Read the value from script with
getAttribute('itemtype'). Chrome and Firefox have no itemType property on elements, soel.itemTypeis undefined.























