About This HTML Issue
Microdata is an HTML specification that lets you embed machine-readable data into your content using three main attributes: itemscope, itemtype, and itemprop. The itemscope attribute creates a new item (a group of name-value pairs), itemtype specifies what kind of thing the item is (using a vocabulary URL like Schema.org), and itemprop defines individual properties within that item. These attributes work together — itemprop only makes sense in the context of an itemscope.
When the validator encounters an itemprop attribute on an element that isn’t a descendant of any element with itemscope, it has no way to associate that property with an item. The property is essentially orphaned. This is a problem for several reasons:
-
Search engines can’t use the data. Structured data consumers like Google, Bing, and other crawlers rely on the
itemscope/itemprophierarchy to understand your content. An orphaneditempropis ignored or misinterpreted. -
Standards compliance. The WHATWG HTML living standard requires that an element with
itempropmust be a property of an item — meaning it must have an ancestor withitemscope, or be explicitly referenced via theitemrefattribute on anitemscopeelement. -
Maintenance issues. Orphaned
itempropattributes suggest that surrounding markup was refactored and the microdata structure was accidentally broken.
The most common causes of this error are:
-
Missing
itemscope— You addeditempropattributes but forgot to define the containing item withitemscope. -
Moved elements — An element with
itempropwas moved outside of its originalitemscopecontainer during a refactor. -
Copy-paste errors — You copied a snippet that included
itempropbut not the parentitemscope.
To fix the issue, either wrap the itemprop elements inside an itemscope container, use itemref to associate distant properties with an item, or remove the itemprop attribute if structured data is not intended.
Examples
Incorrect: itemprop without itemscope
This triggers the validation error because there is no itemscope ancestor:
<div>
<p>My name is <span itemprop="name">Liza</span>.</p>
</div>
Correct: itemprop inside an itemscope container
Adding itemscope (and optionally itemtype) to an ancestor element fixes the issue:
<div itemscope itemtype="https://schema.org/Person">
<p>My name is <span itemprop="name">Liza</span>.</p>
</div>
Correct: nested items with their own scope
When an item contains a sub-item, the nested item needs its own itemscope:
<div itemscope itemtype="https://schema.org/Person">
<p itemprop="name">Liza</p>
<div itemprop="address" itemscope itemtype="https://schema.org/PostalAddress">
<span itemprop="addressLocality">Portland</span>,
<span itemprop="addressRegion">OR</span>
</div>
</div>
Correct: using itemref for properties outside the scope
If you can’t restructure your HTML to nest itemprop inside itemscope, use itemref to reference elements by their id:
<div itemscope itemtype="https://schema.org/Person" itemref="user-name"></div>
<p id="user-name">
My name is <span itemprop="name">Liza</span>.
</p>
In this case, the itemprop="name" element is not a descendant of the itemscope element, but the itemref="user-name" attribute explicitly pulls the referenced element’s tree into the item, making it valid.
Incorrect: scope broken after refactoring
A common real-world scenario where the error appears after restructuring:
<div itemscope itemtype="https://schema.org/Product">
<span itemprop="name">Widget</span>
</div>
<!-- This was moved out of the div above -->
<span itemprop="price">9.99</span>
Fix this by either moving the element back inside the itemscope container, using itemref, or removing the orphaned itemprop.
Find issues like this automatically
Rocket Validator scans thousands of pages in seconds, detecting HTML issues across your entire site.
Learn more: