Where does a microdata property's value come from in HTML?

The Citead team, updated

In short. Microdata property values come from element-specific attributes or descendant text, following the WHATWG value rules.

Definition: A microdata property's value is selected from the element carrying itemprop. The HTML element determines whether the value comes from nested microdata, an attribute such as content, href, src or datetime, or the element's descendant text.

Key facts

  • The WHATWG HTML microdata specification applies the first matching rule in its value list.
  • A meta element supplies its content attribute, while a, area and link use href.
  • audio, embed, iframe, img, source, track and video use src, with the URL parsed relative to the element's document.
  • data and meter use value, and time uses its datetime value.
  • Elements outside those cases supply their descendant text content, according to the same WHATWG section.

How does HTML select the value?

The value algorithm starts with the element that has itemprop. If that element also has itemscope, its value is the item created by that element. This is how a property can contain another group of name and value pairs.

The algorithm then checks element type. A meta property reads content; a URL property reads a URL attribute; data and meter read value; and time reads datetime. If none of those cases matches, the value is the element's descendant text content. The order matters when an element could satisfy more than one description, because the first matching case wins.

The following compact example shows the attribute choices and the text fallback:

<div itemscope>
  <meta itemprop="name" content="The Castle">
  <a itemprop="url" href="/?user=daniel">Daniel</a>
  <img itemprop="image" src="google-logo.png" alt="Google">
  <data itemprop="product-id" value="product-code">The Instigator</data>
  <time itemprop="birthday" datetime="2009-05-10">May 10th 2009</time>
  <span itemprop="description">A book.</span>
</div>

The data and time examples follow the specification's examples. The visible text in those elements is available to readers, while the machine-readable property value comes from the named attribute.

What do href and src contribute?

For a, area and link, the value is produced by parsing and serializing the href value relative to the element's node document. The audio, embed, iframe, img, source, track and video elements follow the corresponding rule for src. A missing attribute or a failed URL result produces the empty string.

The specification calls these elements URL property elements. When a vocabulary defines a property as an absolute URL, the property uses one of them. A string that merely looks like a URL does not trigger that rule when the vocabulary defines the property as a string.

Does the markup describe visible page content?

Google's structured data introduction describes Microdata as an HTML specification that nests structured data within HTML content and uses HTML tag attributes to name properties. It also says that the structured data on a page describes that page's content and that information not visible to the user should not be added, even when accurate.

That guidance gives the page context for the extraction rules. The WHATWG algorithm still determines the property value from the element and its relevant attribute or text. A human-readable label can accompany a machine-readable value, as in data and time, but the two values come from different parts of the element.

How can the value be checked?

Inspect the element carrying itemprop, identify the first matching element case, and record the exact source: content, href, src, value, datetime or descendant text. For URL properties, check the resolved URL as well as the attribute spelling. For a nested item, inspect the element's itemscope and its properties.

Google's documentation recommends the Rich Results Test for checking structured data during development. The test checks implementation details for Google's supported features; the WHATWG value rules explain what the Microdata markup expresses before any feature-specific interpretation.

FAQ

Does visible text always provide a microdata value?

Only when the element reaches the final fallback in the WHATWG value list. Elements such as meta, img and time take their values from content, src and datetime instead.

Should a URL-looking string be placed in an a element?

The vocabulary's property definition controls that choice. The WHATWG specification requires a URL property element when the property is defined as an absolute URL, while a string property remains a text property even when its characters resemble a URL.

Sources

  1. WHATWG, "HTML Standard, Microdata", 19 October 2026
  2. Google Search Central, "Introduction to structured data markup in Google Search", 10 December 2025

Check how a page reads to answer engines. Open the GEO score analyzer

Test a page and see what to fix first

The analysis usually takes less than 10 seconds and needs no account.

400,000+ pages scored in the public benchmark