HTML Guides for itemprop
Learn how to identify and fix common HTML validation errors flagged by the W3C Validator — so your pages are standards-compliant and render correctly across every browser. Also check our Accessibility Guides.
The itemprop attribute cannot be an empty string — it must contain a valid property name when present.
The itemprop attribute is part of the HTML Microdata specification and is used to assign a property name to an element within an itemscope. When a search engine or parser encounters itemprop, it expects a meaningful token that identifies the type of data being described, such as "name", "description", or "url".
If you don't need to mark up the element with microdata, simply remove the itemprop attribute entirely. If you do need it, provide a valid property name that matches the vocabulary you're using (e.g., Schema.org).
HTML Examples
❌ Invalid: empty itemprop
<divitemscopeitemtype="https://schema.org/Product">
<divitemprop="">This causes a validation error</div>
</div>
✅ Fix: provide a valid property name or remove the attribute
<divitemscopeitemtype="https://schema.org/Product">
<divitemprop="description">A great product</div>
</div>
Or, if microdata is not needed:
<div>
<div>No microdata needed here</div>
</div>
The <link> element connects your HTML document to external resources like stylesheets, icons, fonts, and prefetched pages. According to the HTML specification, a <link> element must include at least one of rel, itemprop, or property so that its purpose is clearly defined. A bare <link> with only an href is meaningless—it points to a resource but doesn't explain what that resource is for. The validator raises this error to enforce that every <link> carries semantic meaning.
This matters for several reasons. Browsers rely on these attributes to decide how to handle the linked resource. A <link> with rel="stylesheet" triggers CSS loading, while rel="icon" tells the browser to use the resource as a favicon. Without one of the required attributes, browsers may ignore the element entirely, leading to missing styles, icons, or other resources. It also affects accessibility tools and search engines that parse your markup for structured data.
Understanding the three attributes
rel— The most common attribute. It defines the relationship between your document and the linked resource. Examples includestylesheet,icon,preconnect,preload,canonical, andalternate. Most<link>elements in practice userel.itemprop— Used when the<link>element is part of an HTML Microdata structure. It specifies a property name within anitemscope, linking to a URL as the property's value. This is commonly seen with Schema.org vocabularies.property— Used with RDFa metadata (such as Open Graph tags). It defines a metadata property for the document, likeog:imageorschema:citation.
You only need one of these three attributes to satisfy the requirement, though you can combine them when appropriate.
Examples
Invalid: <link> with no relationship attribute
This triggers the validation error because the element has no rel, itemprop, or property attribute:
<head>
<title>My Page</title>
<linkhref="styles.css">
</head>
Fixed: adding rel for a stylesheet
<head>
<title>My Page</title>
<linkrel="stylesheet"href="styles.css">
</head>
Fixed: common uses of rel
<head>
<title>My Page</title>
<linkrel="stylesheet"href="styles.css">
<linkrel="icon"href="favicon.ico">
<linkrel="preconnect"href="https://fonts.googleapis.com">
<linkrel="canonical"href="https://example.com/page">
</head>
Fixed: using itemprop with Microdata
When a <link> appears inside an element with itemscope, use itemprop to define a property that takes a URL value:
<divitemscopeitemtype="https://schema.org/Article">
<h2itemprop="name">Understanding HTML Validation</h2>
<linkitemprop="mainEntityOfPage"href="https://example.com/article">
</div>
Fixed: using property with RDFa / Open Graph
Open Graph meta tags for social sharing commonly use the property attribute. While <meta> is more typical for Open Graph, <link> with property is valid for URL-type values:
<head>
<title>My Page</title>
<linkproperty="og:image"href="https://example.com/image.jpg">
<linkproperty="schema:citation"href="https://example.com/source.html">
</head>
Invalid: typo or misplaced attribute
Sometimes this error appears because of a misspelled attribute name:
<head>
<title>My Page</title>
<linkrел="stylesheet"href="styles.css">
</head>
Double-check that rel is spelled correctly and isn't accidentally omitted when copying markup from templates or code snippets.
Quick fix checklist
- Linking to a stylesheet, icon, font, or other resource? Add the appropriate
relvalue. - Defining Microdata properties? Use
itempropwithin anitemscopecontext. - Adding RDFa or Open Graph metadata? Use
propertywith the correct vocabulary prefix. - Still seeing the error? Check for typos in the attribute name or ensure the attribute isn't accidentally empty.
The <meta> element provides metadata about the HTML document — information that isn't displayed on the page but is used by browsers, search engines, and other web services. According to the HTML specification, a <meta> tag without any of the recognized attributes is meaningless. The validator flags this because a bare <meta> element (or one with only unrecognized attributes) provides no useful metadata and likely indicates an error or incomplete tag.
This issue commonly occurs when a <meta> tag is left empty by accident, when an attribute name is misspelled (e.g., naem instead of name), or when a required attribute is accidentally deleted during editing.
Most <meta> use cases fall into a few patterns, each requiring specific attribute combinations:
charset— Used alone to declare the document's character encoding.name+content— Used together to define named metadata like descriptions, viewport settings, or author information.http-equiv+content— Used together to simulate an HTTP response header.property+content— Used together for Open Graph and similar RDFa-based metadata.itemprop+content— Used together for microdata annotations.
Note that content alone is not sufficient — it must be paired with name, http-equiv, property, or itemprop to have meaning.
Examples
Incorrect: bare <meta> tag with no attributes
This triggers the validation error because the <meta> element has no recognized attributes:
<meta>
Incorrect: misspelled attribute
A typo in the attribute name means the validator doesn't recognize it:
<metanane="description"content="An example page.">
Incorrect: content without a pairing attribute
The content attribute alone is not enough — it needs name, http-equiv, property, or itemprop:
<metacontent="some value">
Correct: character encoding with charset
<metacharset="UTF-8">
Correct: named metadata with name and content
<metaname="description"content="A brief description of the webpage.">
<metaname="viewport"content="width=device-width, initial-scale=1.0">
<metaname="author"content="Jane Doe">
Correct: HTTP-equivalent with http-equiv and content
<metahttp-equiv="X-UA-Compatible"content="IE=edge">
Correct: Open Graph metadata with property and content
<metaproperty="og:title"content="My Page Title">
<metaproperty="og:description"content="A summary of the page content.">
Correct: microdata with itemprop and content
<metaitemprop="name"content="Product Name">
Full document example
<!DOCTYPE html>
<htmllang="en">
<head>
<metacharset="UTF-8">
<metaname="viewport"content="width=device-width, initial-scale=1.0">
<metaname="description"content="A brief description of the webpage.">
<metaproperty="og:title"content="My Page Title">
<title>Example Page</title>
</head>
<body>
<p>Hello, world!</p>
</body>
</html>
How to fix
- Find the flagged
<meta>tag in your HTML source at the line number the validator reports. - Check for typos in attribute names — make sure
name,charset,http-equiv,property, oritempropis spelled correctly. - Add the missing attribute. Determine what the
<meta>tag is supposed to do and add the appropriate attribute(s). If you can't determine its purpose, it may be safe to remove it entirely. - Ensure proper pairing. If you're using
content, make sure it's paired withname,http-equiv,property, oritemprop. Thecharsetattribute is the only one that works on its own withoutcontent.
The <meta> element is used to provide metadata about an HTML document. According to the HTML specification, a <meta> element must serve a specific purpose, and that purpose is determined by its attributes. A bare <meta> tag or one with only a charset attribute in the wrong context will trigger this validation error.
There are several valid patterns for <meta> elements:
name+content: Standard metadata pairs (e.g., description, viewport, author).http-equiv+content: Pragma directives that affect how the browser processes the page.charset: Declares the document's character encoding (only valid once, in the<head>).itemprop+content: Microdata metadata, which can appear in both<head>and<body>.property+content: Used for Open Graph and RDFa metadata.
When a <meta> tag doesn't match any of these valid patterns, the validator raises this error. The most common causes are:
- Forgetting the
contentattribute when usingnameorproperty. - Using non-standard attributes without the required ones (e.g., only specifying a custom attribute).
- Placing a
charsetmeta in the<body>, where it's not valid. - Typos in attribute names like
contentsinstead ofcontent.
This matters for standards compliance and can also affect SEO and social sharing. Search engines and social media crawlers rely on properly formed <meta> tags to extract page information. Malformed tags may be silently ignored, meaning your metadata won't take effect.
Examples
Incorrect: <meta> with name but no content
<head>
<metacharset="utf-8">
<title>My Page</title>
<metaname="description">
</head>
The <meta name="description"> tag is missing its content attribute, so the validator reports the error.
Correct: <meta> with both name and content
<head>
<metacharset="utf-8">
<title>My Page</title>
<metaname="description"content="A brief description of the page.">
</head>
Incorrect: <meta> with property but no content
<head>
<metacharset="utf-8">
<title>My Page</title>
<metaproperty="og:title">
</head>
Correct: Open Graph <meta> with property and content
<head>
<metacharset="utf-8">
<title>My Page</title>
<metaproperty="og:title"content="My Page">
</head>
Incorrect: <meta> with only a non-standard attribute
<head>
<metacharset="utf-8">
<title>My Page</title>
<metaname="theme-color"value="#ff0000">
</head>
Here, value is not a valid attribute for <meta>. The correct attribute is content.
Correct: Using content instead of value
<head>
<metacharset="utf-8">
<title>My Page</title>
<metaname="theme-color"content="#ff0000">
</head>
Incorrect: Bare <meta> tag with no meaningful attributes
<head>
<metacharset="utf-8">
<title>My Page</title>
<meta>
</head>
A <meta> element with no attributes serves no purpose and should be removed entirely.
Correct: Using itemprop in the <body>
The itemprop attribute allows <meta> to be used within the <body> as part of microdata:
<body>
<divitemscopeitemtype="https://schema.org/Product">
<spanitemprop="name">Example Product</span>
<metaitemprop="sku"content="12345">
</div>
</body>
The <meta> element is most commonly used inside the <head> section to define metadata like character encoding, viewport settings, or descriptions. Inside <head>, attributes like charset, http-equiv, and name are perfectly valid. However, the HTML specification also allows <meta> to appear inside the <body> — but only under specific conditions.
When a <meta> element appears in the <body>, it must have either an itemprop attribute (for microdata) or a property attribute (for RDFa). It must also have a content attribute. Additionally, it cannot use http-equiv, charset, or name attributes in this context. These rules exist because the only valid reason to place a <meta> tag in the <body> is to embed machine-readable metadata as part of a structured data annotation — not to define document-level metadata.
Why this matters
- Standards compliance: The HTML living standard explicitly restricts which attributes
<meta>can use depending on its placement. Violating this produces invalid HTML. - Browser behavior: Browsers may ignore or misinterpret
<meta>elements that appear in the<body>without proper attributes. For example, a<meta http-equiv="content-type">tag inside the<body>will have no effect on character encoding, since that must be determined before the body is parsed. - SEO and structured data: Search engines rely on correctly structured microdata and RDFa. A
<meta>element in the body withoutitemproporpropertywon't contribute to any structured data and serves no useful purpose.
Common causes
- Misplaced
<meta>tags: A<meta>element meant for the<head>(such as<meta http-equiv="...">or<meta name="description">) has accidentally been placed inside the<body>. This can happen due to an unclosed<head>tag, a CMS inserting tags in the wrong location, or simply copying markup into the wrong section. - Missing
itemproporproperty: A<meta>element inside the<body>is being used for structured data but is missing the requireditemproporpropertyattribute.
Examples
Incorrect: <meta> with http-equiv inside the <body>
This <meta> tag belongs in the <head>, not the <body>:
<body>
<metahttp-equiv="content-type"content="text/html; charset=UTF-8">
<form>
<inputtype="text"name="q">
</form>
</body>
Fixed: Move the <meta> to the <head>
<head>
<metahttp-equiv="content-type"content="text/html; charset=UTF-8">
<title>My Page</title>
</head>
<body>
<form>
<inputtype="text"name="q">
</form>
</body>
Incorrect: <meta> in the <body> without itemprop or property
<divitemscopeitemtype="https://schema.org/Offer">
<spanitemprop="price">9.99</span>
<metacontent="USD">
</div>
The <meta> element is missing the itemprop attribute, so the validator reports the error.
Fixed: Add the itemprop attribute
<divitemscopeitemtype="https://schema.org/Offer">
<spanitemprop="price">9.99</span>
<metaitemprop="priceCurrency"content="USD">
</div>
Correct: Using property for RDFa
The property attribute is also valid for <meta> elements in the <body> when using RDFa:
<divvocab="https://schema.org/"typeof="Event">
<spanproperty="name">Concert</span>
<metaproperty="startDate"content="2025-08-15T19:00">
</div>
Incorrect: <meta name="..."> inside the <body>
The name attribute is only valid on <meta> elements inside the <head>:
<body>
<metaname="author"content="Jane Doe">
<p>Welcome to my site.</p>
</body>
Fixed: Move it to the <head>
<head>
<title>My Site</title>
<metaname="author"content="Jane Doe">
</head>
<body>
<p>Welcome to my site.</p>
</body>
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 <spanitemprop="name">Liza</span>.</p>
</div>
Correct: itemprop inside an itemscope container
Adding itemscope (and optionally itemtype) to an ancestor element fixes the issue:
<divitemscopeitemtype="https://schema.org/Person">
<p>My name is <spanitemprop="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:
<divitemscopeitemtype="https://schema.org/Person">
<pitemprop="name">Liza</p>
<divitemprop="address"itemscopeitemtype="https://schema.org/PostalAddress">
<spanitemprop="addressLocality">Portland</span>,
<spanitemprop="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:
<divitemscopeitemtype="https://schema.org/Person"itemref="user-name"></div>
<pid="user-name">
My name is <spanitemprop="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:
<divitemscopeitemtype="https://schema.org/Product">
<spanitemprop="name">Widget</span>
</div>
<!-- This was moved out of the div above -->
<spanitemprop="price">9.99</span>
Fix this by either moving the element back inside the itemscope container, using itemref, or removing the orphaned itemprop.
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.
Pro Trial
Full Pro access. Cancel anytime.
Start Pro Trial →Join teams across 40+ countries