gptagency.io

Microdata

Microdata is a markup language with which you embed structured data directly into the HTML code of your web page. Via additional attributes such as itemscope, itemtype and itemprop, you mark up individual pieces of content, for example a price or an opening hour, so that search engines and AI systems recognize their meaning unambiguously instead of just seeing the plain text.

Why microdata matters for AI visibility

AI assistants and search engines read your page differently than a human. They see letters, but not automatically whether "49" is a price, a house number or a rating. Microdata gives this text a machine-readable meaning. You explicitly tell the system: this here is the name of the business, that the address, that the price. This increases the chance that an AI like ChatGPT or Perplexity understands your information correctly, cites it cleanly and recommends it further in an answer. Without this structure, the machine has to guess – and guessing leads to errors or to your page not showing up as a reliable source in the first place. Microdata therefore lowers the risk of misunderstandings.

How microdata works technically

Microdata works with three central attributes that you attach directly to existing HTML tags. With itemscope you open an area that describes an object, for instance a product. With itemtype you link to a vocabulary, usually from schema.org, that defines the allowed properties. With itemprop you then mark each individual property within this area, for example name, price or ratingValue. The advantage: the markup sits exactly where the visible content is. The disadvantage compared to today's common JSON-LD: the code becomes more cluttered, because markup and content mix. Microdata, together with RDFa and JSON-LD, is one of the three formats with which you can implement structured data according to schema.org.

Common mistakes with microdata

The classic mistake is marked-up content that isn't visible to visitors at all. If you mark up a five-star rating that appears nowhere on the page, search engines regard that as manipulation and may penalize your page. Equally common: incorrectly nested areas, where an itemprop stands outside its itemscope and thereby runs into nothing. Outdated or invented itemtype values that don't exist at schema.org also cause the markup to be ignored. So always check your microdata with a testing tool like the Schema Markup Validator or Google's Rich Results Test before you go live. This way you catch typos and missing mandatory fields before they cost you visibility.

Microdata in relation to JSON-LD

Microdata was the standard for a long time, but is now considered the older variant. Google and most AI systems now prefer JSON-LD, because this format bundles the structured data in a separate script block, separated from the visible HTML. That keeps your page code clean and makes changes easier. Microdata nevertheless remains valid and continues to be read out. So if you run an existing page with microdata, you don't have to rebuild it right away. For new projects, JSON-LD is usually worthwhile. What's decisive for your AI visibility is not the format itself, but that the data is correct, complete and consistent with the visible content – regardless of whether marked up via microdata or JSON-LD.

Example

Imagine a small bike shop that offers both repairs and sales. On the homepage, the company name, the address and the opening hours appear as normal text. A human understands this immediately. An AI initially sees only words. The shop owner now marks up the details with microdata: he marks the company name with itemprop="name", the street with itemprop="streetAddress" and the opening hours accordingly. If someone asks an AI assistant "When is the bike shop near me open?", the system can now attribute the hours unambiguously and reproduce them correctly.

Common questions

Are microdata and schema.org the same?

No. Schema.org is the vocabulary, that is, the list of terms like Product or opening hour. Microdata is one of three formats with which you build this vocabulary technically into your page. The other two are JSON-LD and RDFa.

Should I use microdata or JSON-LD for a new page?

For new projects JSON-LD is usually recommended, because it keeps the code cleaner and is preferred by Google as well as AI systems. Microdata still works, but is the more laborious and older variant.

Related terms