The HTML itemprop attribute
The HTML itemprop attribute marks content as a microdata property, such as a name or keywords. It goes inside an element with itemscope, as in <span itemprop="name">Avatar</span>. Depending on the element, the value is its text, a URL or an attribute such as datetime.
Overview
The HTML itemprop attribute names a property of a microdata item, and its element supplies the value. Any element can carry it, as long as it sits inside an element with itemscope or is pulled in through itemref. The attribute changes nothing on screen.
The element decides which part becomes the value. A span or p gives its text, an img its src URL, an a or link its href, and a meta its content. A time element gives its datetime, while data and meter give their value.
In a typed item, property names come from the vocabulary that itemtype points to. With itemtype="https://schema.org/Book", schema.org defines names such as author. In an untyped item, names are your own, and only a name written as a full URL may contain a dot or colon.
One itemprop can hold several space-separated names, and repeating a name gives a property several values. Google reads microdata for rich results, and its documentation calls JSON-LD, microdata and RDFa equally fine when valid, recommending JSON-LD where a site's setup allows it.
Syntax
<div itemscope itemtype="https://schema.org/Book">
<span itemprop="name">Weekend Bread Baking</span>
by <span itemprop="author">Sam Rivera</span>
</div>
Values
| Value |
|---|
| One or more space-separated property names. |
Example
<div itemscope itemtype="https://schema.org/Book">
<h2 itemprop="name">Weekend Bread Baking</h2>
<p>By <span itemprop="author">Sam Rivera</span>, published
<time itemprop="datePublished" datetime="2025-03-14">March 14, 2025</time></p>
<meta itemprop="keywords" content="bread, baking, sourdough">
<link itemprop="url" href="https://example.com/weekend-bread">
</div>
<pre id="out"></pre>
<script>
const rows = [];
for (const el of document.querySelectorAll('[itemscope] [itemprop]')) {
let value = el.textContent.trim();
if (el.tagName === 'META') value = el.content;
else if (el.tagName === 'TIME') value = el.dateTime;
else if (el.tagName === 'LINK') value = el.href;
rows.push(el.getAttribute('itemprop') + ' = ' + value);
}
document.getElementById('out').textContent = rows.join('\n');
</script>
Best practices
- Take itemprop names from the type in itemtype, such as
nameandauthorfor a schema.org Book. Tools that read schema.org then know what each name means. - Put dates in <time> with a
datetimeattribute, and machine-readable numbers in<data value>or<meter value>. The visible text can then stay friendly. - Give URL values through
a,link,imgor another URL property element. The HTML standard requires one of these elements for any property its vocabulary defines as a URL. - List several values by repeating the name, such as one
itemprop="recipeIngredient"per ingredient, instead of packing them into one element. Keywords differ, since schema.org also allows a comma-separated list for them. - Run the markup through a microdata checker, such as the Schema Markup Validator, before you publish. It extracts the microdata items from your HTML and checks them.
Frequently asked questions
What is itemprop in HTML?
How do I use itemprop keywords?
Is itemprop keywords the same as the keywords meta tag?
What does itemprop do on a span?
<span itemprop=name>Avatar</span> sets name to Avatar. Use it when the value already appears as visible text.






















