Microdata & Structured Data

Course 2 · Ch 9
Microdata & Structured Data
Schema.org vocabulary, embedded directly in your markup, that earns rich search result features other pages don't get

Search engines parse a page's text well enough, but structured data goes further: explicitly labelling what kind of thing a piece of content is (a recipe, a product, an FAQ, an article) using a shared, standardised vocabulary — schema.org — that search engines specifically look for and reward with enhanced result displays.

What Structured Data Actually Buys You

Linux Performance Tuning — Free Course
osztromok.com › linux › performance
★★★★★ 4.8 rating · 8 chapters · Free
Learn to diagnose CPU, memory, disk, and network bottlenecks on Linux, scenario by scenario.

That star rating and metadata row is a "rich result" — search engines only show this for pages with valid structured data describing the content as a Course or similar type. Without it, the exact same page shows only as a plain text snippet, regardless of how good the actual content is.

JSON-LD — The Recommended Format

Schema.org data can be embedded three different ways historically (microdata attributes directly in HTML tags, RDFa, or JSON-LD) — Google explicitly recommends JSON-LD today, since it's cleanly separated from the visible markup and far easier to generate and validate correctly.

<script type="application/ld+json"> { "@context": "https://schema.org", "@type": "Course", "name": "Linux Performance Tuning", "description": "Learn to diagnose CPU, memory, disk, and network bottlenecks on Linux.", "provider": { "@type": "Organization", "name": "osztromok.com" } } </script>

This block lives in <head> (or anywhere in <body>) and is never displayed to visitors at all — it exists purely for search engine crawlers and other automated tools to read.

Microdata — The In-Markup Alternative

The older alternative embeds the same vocabulary directly as attributes on the visible HTML elements themselves — still valid, but generally considered messier to maintain than a separate JSON-LD block.

<div itemscope itemtype="https://schema.org/Course"> <h2 itemprop="name">Linux Performance Tuning</h2> <p itemprop="description">Learn to diagnose CPU, memory, disk, and network bottlenecks.</p> </div>
JSON-LD
Separate block, doesn't touch visible markup, easiest to generate programmatically and validate independently. Generally the recommended default for new projects.
Microdata
Attributes woven directly into existing tags — no duplication of content, but couples the structured data tightly to the visible HTML's exact structure.

Common schema.org Types Worth Knowing

  • Article / BlogPosting — for written content, enables author/date display in results.
  • FAQPage — for question/answer content, can produce an expandable FAQ display directly in search results.
  • Recipe — enables rich recipe cards with cook time, ratings, and ingredient previews.
  • Product — enables price, availability, and review star display.
  • BreadcrumbList — shows a breadcrumb trail (Home › Linux › Performance) in the search result URL line itself, instead of a raw URL.
  • Course — used in the example above, relevant directly to osztromok.com's actual content.
FAQPage pairs naturally with Chapter 8's details/summary element
A visible FAQ built from <details>/<summary> pairs and a matching FAQPage JSON-LD block describing the same questions and answers is a genuinely common, complementary real-world pairing — the visible HTML serves users, the structured data serves search engines, both describing the identical content.

Validating Structured Data

Google's Rich Results Test (and the more general Schema.org Validator) checks a URL or pasted code against the actual schema definitions, flagging missing required properties and genuine syntax errors — directly analogous to Fundamentals Chapter 10's W3C validator, but specifically for structured data rather than HTML markup itself.

Structured data must accurately describe content that's genuinely visible on the page
Search engines actively penalise structured data that doesn't match what a visitor would actually see — claiming a 5-star rating in JSON-LD with no actual reviews or rating system visible anywhere on the page is exactly the kind of mismatch that can trigger a manual action against a site. Structured data should describe real, visible content, never invented or exaggerated claims purely to win rich results.

Chapter 9 Quick Reference

  • Structured data — explicitly labels content type using shared schema.org vocabulary, enabling rich search results
  • JSON-LD — recommended format; a separate <script type="application/ld+json"> block, invisible to visitors
  • Microdata — older alternative, woven directly into visible tags via itemscope/itemtype/itemprop
  • Common types: Article, FAQPage, Recipe, Product, BreadcrumbList, Course
  • FAQPage + details/summary — a natural, common real-world pairing (Chapter 8)
  • Validate with Google's Rich Results Test or the Schema.org Validator
  • Never claim content that isn't genuinely visible on the page — mismatched structured data can trigger search engine penalties
  • Next chapter: forms + JavaScript — client-side validation hooks, FormData