itemscope
Creates a new Microdata item scope. Required for using itemid.
itemid AttributeThe itemid attribute provides a unique global identifier for a Microdata item. It allows you to specify a globally unique identifier for an item using standard identifier schemes like ISBN for books, GTIN for products, or URLs.
<element itemscope itemtype="type-url" itemid="identifier"> <!-- Item properties --></element>Use the itemid attribute when marking up items that have globally unique identifiers recognized by standard schemes:
Use ISBN (International Standard Book Number) for books and publications:
Use GTIN (Global Trade Item Number) or UPC for retail products:
Use URLs when the item has a canonical web address:
The International Standard Book Number is a unique numeric commercial book identifier:
<!-- Using URN format --><div itemscope itemtype="https://schema.org/Book" itemid="urn:isbn:978-0-545-01022-1"> <span itemprop="name">Harry Potter and the Deathly Hallows</span></div>
<!-- Or using URL format --><div itemscope itemtype="https://schema.org/Book" itemid="https://www.worldcat.org/isbn/9780545010221"> <span itemprop="name">Harry Potter and the Deathly Hallows</span></div>Global Trade Item Numbers identify products worldwide:
<!-- GTIN-13 (EAN) --><div itemscope itemtype="https://schema.org/Product" itemid="urn:gtin:5012345678900"> <span itemprop="name">Product Name</span></div>
<!-- UPC (GTIN-12) --><div itemscope itemtype="https://schema.org/Product" itemid="urn:gtin:012345678905"> <span itemprop="name">Product Name</span></div>Digital Object Identifiers for scholarly articles and research:
<article itemscope itemtype="https://schema.org/ScholarlyArticle" itemid="https://doi.org/10.1000/182"> <h2 itemprop="headline"> The Impact of Climate Change on Ecosystems </h2> <span itemprop="author">Dr. Sarah Johnson</span></article>You can use custom URN schemes for internal or domain-specific identifiers:
<div itemscope itemtype="https://schema.org/Organization" itemid="urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6"> <span itemprop="name">Acme Corporation</span></div>The itemid and id attributes serve different purposes:
Purpose: Global identifier for Microdata items
Scope: Must be globally unique across the web
Format: Must be a URL or URN
Usage: For structured data consumed by search engines and tools
<div itemscope itemtype="https://schema.org/Book" itemid="urn:isbn:978-0-262-03384-8"> <span itemprop="name"> Introduction to Algorithms </span></div>Purpose: Unique identifier within a single HTML document
Scope: Must be unique only within the current page
Format: Any string without spaces (case-sensitive)
Usage: For CSS styling, JavaScript, and page navigation
<div id="book-section"> <h2>Featured Books</h2> <p>Check out our collection...</p></div>
<style> #book-section { padding: 20px; background: #f3f4f6; }</style>Choose well-established identifier schemes appropriate for your content type:
<!-- Good: Using standard ISBN format --><div itemscope itemtype="https://schema.org/Book" itemid="urn:isbn:978-1-449-36830-3">
<!-- Good: Using DOI for research paper --><article itemscope itemtype="https://schema.org/ScholarlyArticle" itemid="https://doi.org/10.1038/nature12373">
<!-- Avoid: Using non-standard or unclear identifiers --><div itemscope itemtype="https://schema.org/Book" itemid="book123">Not every item needs an itemid. Use it only for items with established global identifiers:
<!-- Good: Book has ISBN, use itemid --><div itemscope itemtype="https://schema.org/Book" itemid="urn:isbn:978-0-13-110362-7">
<!-- Good: Blog post without global ID, no itemid needed --><article itemscope itemtype="https://schema.org/BlogPosting"> <h1 itemprop="headline">My Latest Blog Post</h1></article>The itemid attribute requires both itemscope and itemtype to be present:
<!-- Correct: All three attributes present --><div itemscope itemtype="https://schema.org/Product" itemid="urn:gtin:00012345678905">
<!-- Invalid: Missing itemscope --><div itemtype="https://schema.org/Product" itemid="urn:gtin:00012345678905">
<!-- Invalid: Missing itemtype --><div itemscope itemid="urn:gtin:00012345678905">The identifier must be a properly formatted URL or URN:
<!-- Good: Valid URN --><div itemscope itemtype="https://schema.org/Book" itemid="urn:isbn:978-0-596-00048-9">
<!-- Good: Valid URL --><div itemscope itemtype="https://schema.org/Person" itemid="https://example.com/users/12345">
<!-- Invalid: Not a URL or URN --><div itemscope itemtype="https://schema.org/Book" itemid="some-book-title">The itemid attribute is part of the HTML5 Microdata specification and is supported by all modern browsers.
| Browser | Support |
|---|---|
| Chrome | Yes (since Chrome 8) |
| Firefox | Yes (since Firefox 6) |
| Safari | Yes (since Safari 5.1) |
| Edge | Yes (all versions) |
| Opera | Yes (since Opera 11) |
itemscope
Creates a new Microdata item scope. Required for using itemid.
itemtype
Specifies the vocabulary URL for the item. Required for using itemid.
itemprop
Adds a property to a Microdata item with a name-value pair.