The HTML itemid attribute
The HTML itemid attribute gives a microdata item a globally unique identifier, expressed as a URL. It is used together with itemscope and itemtype, for vocabularies whose types support a unique ID.
Overview
The itemid attribute attaches a stable, globally unique identifier (written as a URL) to a microdata item. It lets different pages or items refer to the same underlying thing (a specific book, product or person), which some schema.org vocabularies use.
It is only meaningful on an element that already has both itemscope and an itemtype whose definition supports global identifiers.
Syntax
<div itemscope itemtype="https://schema.org/Book" itemid="urn:isbn:0-330-25864-8"> … </div>
Values
| Value |
|---|
| A URL (or URN) that uniquely identifies the item. |
Example
<div itemscope itemtype="https://schema.org/Book" itemid="urn:isbn:978-0131103627">
<span itemprop="name">The C Programming Language</span>
</div>
Best practices
- Write
itemidas an absolute URL. A relative value is resolved against the page's base URL, so identical markup on two pages can yield two different identifiers for the same thing. - Check your vocabulary's rules before two items share one itemid. HTML leaves it to each vocabulary to say whether duplicates may exist, on one page or across pages, and how to handle them.
- An itemid is not an id. The id attribute names one element within its document, and itemref lists those ids, while itemid gives the item a global identifier that items on other pages can relate to.
- An item used as a property value, like a product's manufacturer, takes an itemid on its own element. Whether that's allowed depends on its own itemtype, so check that this vocabulary supports global identifiers too.























