Skip to main content
HTML Validation

Bad value “” for attribute “itemprop” on element “X”.

About This HTML Issue

The itemprop attribute needs at least one property name, so an empty value such as itemprop="" is invalid on any element.

itemprop belongs to HTML microdata. It marks an element as a property of the item created by its nearest itemscope ancestor, and its value is a space-separated list of property names, such as headline, image or author, or absolute URLs. An empty string, or a value made only of spaces, contains no names, and the validator reports it together with the element that carries it.

Empty values usually come from a theme or template that always prints the attribute and fills it in only when a property is configured. The microdata processing model skips any element whose itemprop has no names, so the attribute adds nothing to the item. On an <img>, the property value would be the image URL from src, and that value is lost.

Either write the property name your vocabulary defines (for a Schema.org Article, the main picture is image) or remove the attribute. Removing it is the right fix when the element sits outside any itemscope, because a named itemprop there triggers a different error saying the element is not a property of any item.

Invalid example

<article itemscope itemtype="https://schema.org/Article">
  <h1 itemprop="headline">Spring hiking routes</h1>
  <img src="trail.jpg" alt="A trail along a cliff" itemprop="">
</article>

Valid example

<article itemscope itemtype="https://schema.org/Article">
  <h1 itemprop="headline">Spring hiking routes</h1>
  <img src="trail.jpg" alt="A trail along a cliff" itemprop="image">
</article>

Without microdata, drop the attribute:

<article>
  <h1>Spring hiking routes</h1>
  <img src="trail.jpg" alt="A trail along a cliff">
</article>

Find issues like this automatically

Rocket Validator scans thousands of pages in seconds, detecting HTML issues across your entire site.

Help us improve our guides

Was this guide helpful?
🌍 Trusted by teams worldwide

Validate at scale.
Ship accessible websites, faster.

Automated HTML & accessibility validation for large sites. Check thousands of pages against WCAG guidelines and W3C standards in minutes, not days.

Scheduled Reports
API Access
Open Source Standards
€5 / week

1K Weekly

1,000 monthly checks. Cancel anytime.

Get 1K Weekly →

Join teams across 40+ countries