🍱 Lunchbox Hands

seo

Structured Data & JSON-LD: A Practical Guide to Rich Results

A developer-focused guide to structured data and JSON-LD — what schema.org markup actually does for search, why JSON-LD beats microdata, which schema types earn rich results, where to put the script, and how to validate it before it ships.

You’ve seen them in search results: star ratings under a product, an FAQ that expands inline, a recipe with a photo and cook time, breadcrumbs instead of a raw URL. Those rich results don’t happen by accident — they’re driven by structured data you add to your pages. Here’s what it is, how to write it, and how to not ship it broken.

What structured data actually does

A search engine can read your page’s text, but it has to infer what things mean. Structured data removes the guesswork: it’s a machine-readable description, embedded in the page, that says “this is a Product, its price is $29, its rating is 4.6 from 120 reviews.” Search engines use that to:

  • Render rich results — stars, prices, FAQs, breadcrumbs, sitelinks — which take up more space and earn more clicks.
  • Understand entities — what your page is about, not just which words it contains.
  • Feed knowledge panels and AI answers — increasingly the surfaces that decide whether you get seen at all.

Structured data doesn’t directly boost rankings, but the click-through rate from a richer listing very much affects your traffic. It’s one of the higher-leverage items on any on-page SEO checklist.

The vocabulary vs. the format

Two things get conflated. Keep them separate:

  • schema.org is the vocabulary — the shared dictionary of types (Product, Article, FAQPage, Organization) and their properties (name, price, author).
  • JSON-LD / microdata / RDFa are formats — different ways to embed that vocabulary in HTML.

Google supports all three formats, but JSON-LD is the recommended one, and it’s what you should write.

Why JSON-LD wins

Microdata and RDFa interleave attributes into your visible HTML (itemscope, itemprop sprinkled across <div>s). That couples your markup to your markup — change the layout, break the data. JSON-LD instead lives in a single <script> block, completely separate from the rendered HTML:

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Article",
  "headline": "Structured Data & JSON-LD: A Practical Guide",
  "datePublished": "2026-06-29",
  "author": { "@type": "Organization", "name": "Lunchbox Hands" }
}
</script>

Advantages that matter in practice:

  • Decoupled — your visible HTML and your structured data evolve independently.
  • Easy to generate — it’s just a JSON object you can build server-side from the same data you already render.
  • Easy to inject — frameworks can drop it in the <head>; this very blog emits Article JSON-LD that way.

Note @context (the vocabulary, always schema.org) and @type (the specific type) — those two keys anchor every block.

The schema types worth your time

Don’t mark up everything — mark up what earns a rich result for your content:

TypeUse it forRich result
Article / BlogPostingblog posts, newsheadline, date, top-stories eligibility
Product + Offerstore/product pagesprice, availability, stars
FAQPagepages with Q&Aexpandable questions inline
BreadcrumbListany nested pagebreadcrumb trail in the URL line
Organizationsite-wide (home page)knowledge panel, logo
HowTo / Recipestep-by-step / recipessteps, time, image
Eventevent pagesdate, location, tickets

A few high-value ones — Organization on your home page, BreadcrumbList site-wide, and Article on posts — cover most sites. Generate the boilerplate fast with the schema markup generator and the meta tag generator for the rest of your head.

The rules that keep you out of trouble

Google enforces structured-data guidelines, and violations either silently drop your rich result or, in bad cases, trigger a manual action. The big ones:

  1. The markup must match visible content. Don’t claim a 5-star rating that isn’t shown on the page. Marking up content users can’t see is a violation.
  2. Mark up the page it describes. Put Product data on the product page, not the category page.
  3. Fill the required properties. Each type has required fields; miss one and the rich result won’t render even if the JSON is valid.
  4. One canonical truth. If you have duplicate URLs, the structured data should live on (or agree with) the canonical version.

Where to put it and how to test it

Place the <script type="application/ld+json"> in the <head> or anywhere in the <body> — position doesn’t matter to parsers. If your pages are server-rendered, emit it server-side; if they’re client-rendered, make sure the JSON-LD is present in the HTML the crawler first receives, not injected only after hydration.

Then — always validate before shipping. A single trailing comma makes the whole block invalid JSON, and one missing required field silently kills the rich result. Two checks to run:

  • Paste your markup into the structured data validator to confirm the JSON parses and the schema types are well-formed.
  • Run the live page through the SEO analyzer to catch missing structured data alongside the rest of your on-page issues.

The recap

  • Structured data tells search engines what your page means, unlocking richer, higher-CTR listings.
  • Use schema.org as the vocabulary and JSON-LD as the format — one clean <script> block, decoupled from your HTML.
  • Pick the few types that earn rich results for your content (Article, Product, FAQPage, BreadcrumbList, Organization).
  • Keep the markup honest, complete, and on the right page — then validate every block before it goes live.

Structured data is one of the rare SEO levers that’s almost pure engineering: write a correct JSON object, validate it, ship it. Start with the schema generator, confirm it in the validator, and fold it into your broader on-page SEO work.