The HTML itemid attribute
Quick answer
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
Frequently asked questions
What does the itemid attribute do?
Specifies the unique item id.
What is HTML microdata?
Should I use microdata or JSON-LD?
Both work. JSON-LD keeps structured data in one script block and is often easier to maintain; microdata annotates the visible markup directly.
Is itemid a global attribute?
Yes — it is a global attribute, so it can be set on any HTML element (it is a global attribute).