HTML reference
itemprop
The Microdata itemprop attribute labels what a piece of content means inside an item, such as a name, price, author, or publication date.
What you will learn
- What property name
itempropadds - How it relates to
itemscopeanditemtype - How to keep machine-readable data aligned with visible content
See how three attributes describe a person
Microdata adds labels to HTML so software can identify what the information means. These three attributes have different jobs.
| Attribute | Job | In this example |
|---|---|---|
itemscope | Starts one item | One person’s profile |
itemtype | Identifies the kind of item | https://schema.org/Person |
itemprop | Names a property of the item | name = the person’s name |
<div itemscope itemtype="https://schema.org/Person">
<p itemprop="name">Aki</p>
</div>
The page displays “Aki”. These attributes do not change the text’s size or color. A program that reads Microdata can identify Aki as the name of a person.
Try keeping two people’s names separate
Aki
Kai
HTML for the grouping above
<div itemscope itemtype="https://schema.org/Person">
<p itemprop="name">Aki</p>
</div>
<div itemscope itemtype="https://schema.org/Person">
<p itemprop="name">Kai</p>
</div>
The name values read from these items
- Person 1: name = Aki
- Person 2: name = Kai
With separate items, Aki and Kai belong to different people.
This example shows which person owns each name. It is not a validator for every kind of Microdata.
Where a property value comes from
| Markup | Value |
|---|---|
<span itemprop="name">Aki</span> | Aki |
<meta itemprop="priceCurrency" content="JPY"> | JPY |
<data itemprop="price" value="19800">19,800</data> | 19800 |
<img itemprop="image" src="photo.jpg" alt="…"> | The image URL resolved from src |
<time itemprop="birthDate" datetime="2000-11-27">…</time> | 2000-11-27 |
For example, a span normally supplies its text. To provide a differently formatted value, use the mechanism defined for that element, such as value on data.
Connect a nested item with a property name
A product and its offer are different items. Use Product for the product, and an Offer connected by offers for the price and currency.
<article itemscope itemtype="https://schema.org/Product">
<h2 itemprop="name">Headphones X100</h2>
<div itemprop="offers" itemscope
itemtype="https://schema.org/Offer">
<meta itemprop="priceCurrency" content="JPY">
<p><data itemprop="price" value="19800">19,800</data> JPY</p>
<link itemprop="availability" href="https://schema.org/InStock">
<p>In stock</p>
</div>
</article>
Check what you have written
- Paste the code into Schema Markup Validator and check the Person items and name values.
- Use Rich Results Test to check features Google supports. Check the eligible item types and their required properties.
If a minimal Person example is not eligible for a rich result, that does not by itself make the Microdata invalid. Rich results are search listings with features such as rating stars. Correct structured data does not guarantee a ranking increase or a rich result.
JSON-LD writes structured data separately from the visible HTML. If you are adding structured data, consider this format as well. Google recommends JSON-LD when your site can use it.
Check your understanding: write two separate person items and explain which attribute keeps their names separate.
Sources: HTML Microdata values, Schema.org price, and Google’s structured data guide.
Basic example
<article itemscope itemtype="https://schema.org/Book">
<h2 itemprop="name">The Web Guide</h2>
<span itemprop="author">A. Reader</span>
</article>The item type defines which properties are meaningful. Use documented property names, and place the attribute on content that actually expresses that property.
Value depends on the element
Text elements generally expose their text. A link can expose its URL, an image its src, and a meta element can expose its content. Use these forms carefully so the structured value matches what users can understand.
Truthful annotations
Do not add hidden or misleading properties just to influence search results. Validate the vocabulary and keep structured data consistent with the visible page.