Structured Data with JSON-LD
A search crawler reads your page twice: once as a human would, skimming headings and links, and once as a database looking for entities it can file. Structured data is the bridge between those two readings â a small, machine-readable block that states, without ambiguity, that this page is an Article published by a named organization on a specific date, or that the product shown costs 99.99 USD and is in stock. Get it right and search engines can render star ratings, FAQ expanders, breadcrumb trails and sitelinks directly on the results page. Get it wrong and you either waste the opportunity or trigger manual actions. This lesson covers the JSON-LD format, the schema types worth implementing first, and the validation workflow that keeps markup honest.
Why machine-readable pages outperform guesswork
Left alone, a crawler infers meaning from heuristics: heading order, link anchors, image alt text, the presence of a price-like string near a buy button. Heuristics fail on unusual layouts, client-rendered content and multilingual sites, and they cannot distinguish a review of a camera from an offer to sell one. Schema.org vocabulary gives every major content type a shared definition used by Google, Bing, Yandex and a growing list of application developers. When your markup matches those definitions exactly, the search engine can promote the right metadata into rich results â visual enhancements that increase click-through without changing your ranking position.
The flip side is equally important: structured data must reflect what users can see on the page. Marking up a rating that does not appear in the visible review, hiding prices from users while advertising them to crawlers, or listing FAQ content nobody sees violates spam policies and can produce a manual action far more costly than the missing rich result ever was.
How JSON-LD plugs into an HTML document
JSON-LD (JavaScript Object Notation for Linked Data) is a script block with a dedicated MIME type. Browsers treat it as inert data â nothing executes â while crawlers parse it as a full JSON document linked to the Schema.org context. The recommended placement is inside the head or right after the main content; multiple blocks on one page are allowed and are the cleanest way to combine an Article graph with an Organization graph and a BreadcrumbList.
Each block needs three anchors: the @context pointing at Schema.org, an @type naming the entity, and properties drawn from that type's definition. Values can be literals, URLs, or nested nodes that themselves carry a type, which is how author and publisher objects are expressed. Keep IDs stable â the same @id for the organization across every page lets crawlers merge those mentions into one entity in the knowledge graph.
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "Organization",
"@id": "https://example.com/#org",
"name": "Northwind Journal",
"url": "https://example.com",
"logo": {
"@type": "ImageObject",
"url": "https://example.com/img/logo.png",
"width": 512,
"height": 512
}
},
{
"@type": "Article",
"@id": "https://example.com/blog/html-structured-data/#article",
"headline": "Structured Data That Earns Rich Results",
"description": "A field guide to JSON-LD markup that search engines trust.",
"author": {
"@type": "Person",
"name": "Priya Raman",
"url": "https://example.com/authors/priya/"
},
"publisher": { "@id": "https://example.com/#org" },
"datePublished": "2026-03-14",
"dateModified": "2026-04-02",
"image": [
"https://example.com/img/article-1200.jpg",
"https://example.com/img/article-1600.jpg"
],
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "https://example.com/blog/html-structured-data/"
}
},
{
"@type": "BreadcrumbList",
"itemListElement": [
{ "@type": "ListItem", "position": 1, "name": "Home",
"item": "https://example.com/" },
{ "@type": "ListItem", "position": 2, "name": "Blog",
"item": "https://example.com/blog/" },
{ "@type": "ListItem", "position": 3,
"name": "Structured Data That Earns Rich Results" }
]
}
]
}
</script>
The @graph wrapper keeps the three nodes in a single block while letting them reference each other through @id. That pattern scales: add a WebSite node with a SearchAction and your site becomes eligible for a sitelink search box without duplicating organization data in every article.
The schema types that earn rich results first
Not every schema type produces a visible enhancement, and eligibility rules change over time, so treat the following as a prioritized starting portfolio rather than a guarantee. Articles with a clear headline, author, date and image can appear as top stories or rich previews. Products with price, availability and aggregate ratings can show offers and stars. Recipes, how-to guides, events, videos and FAQ pages each have dedicated displays. Local businesses benefit from LocalBusiness with hours and address; software products can describe offers and application categories.
| Schema type | Key required properties | Typical rich result | Good fit for |
|---|---|---|---|
| Article / NewsArticle | headline, image, datePublished, author | Article preview, Top Stories | Blog, news, docs |
| Product | name, image, offers with price and availability | Product card with price | E-commerce |
| AggregateRating | ratingValue, reviewCount | Star display | Products, local business |
| FAQPage | mainEntity of Question and Answer pairs | Expandable Q&A | Support, product pages |
| HowTo | name, step list with instructions | Step carousel | Tutorials, guides |
| Event | name, startDate, location or online URL | Event listing | Conferences, meetups |
| BreadcrumbList | ordered ListItem positions | Breadcrumb trail | Any hierarchical site |
| VideoObject | name, thumbnailUrl, uploadDate, duration | Video rich result | Embedded media |
| Organization | name, logo, url, sameAs | Knowledge panel signals | Site-wide graph |
Mark up only what the page visibly contains. If the FAQ section renders from an accordion the crawler cannot expand, include the questions in the initial HTML â the same progressive-enhancement discipline you would apply for any other content.
The site-wide graph every page should carry
Three node types deserve a place on essentially every URL: Organization, WebSite and BreadcrumbList. Together they tell the crawler who publishes the site, what the site is called, how search within it works, and where the current page sits in the hierarchy. Because they repeat across pages, define them once with stable @id values and reference them from page-specific nodes instead of re-declaring each one.
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebSite",
"@id": "https://example.com/#website",
"name": "Northwind Journal",
"url": "https://example.com",
"publisher": { "@id": "https://example.com/#org" },
"potentialAction": {
"@type": "SearchAction",
"target": {
"@type": "EntryPoint",
"urlTemplate": "https://example.com/search?q={search_term_string}"
},
"query-input": "required name=search_term_string"
}
}
</script>
The SearchAction template is what powers the sitelink search box in some result layouts. Keep the braces in urlTemplate exactly as written â they are part of the Schema.org URL template convention and must survive JSON serialization untouched.
Building product markup that validates
Product pages combine several node types, which is where mistakes cluster. Offers need a price expressed as a string or number plus an explicit priceCurrency in ISO 4217 form; availability must come from the Schema.org enum, not free text. Aggregate ratings must correspond to visible reviews on the page. The following block is a complete, valid pattern you can adapt:
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Product",
"name": "Aurora Wireless Headphones",
"sku": "AWN-220",
"brand": {
"@type": "Brand",
"name": "AudioTech"
},
"image": "https://shop.example.com/img/aurora-1200.jpg",
"description": "Over-ear wireless headphones with 40-hour battery life.",
"offers": {
"@type": "Offer",
"url": "https://shop.example.com/p/aurora",
"priceCurrency": "USD",
"price": "199.00",
"availability": "https://schema.org/InStock",
"itemCondition": "https://schema.org/NewCondition",
"shippingDetails": {
"@type": "OfferShippingDetails",
"shippingRate": {
"@type": "MonetaryAmount",
"value": "0",
"currency": "USD"
},
"deliveryTime": {
"@type": "ShippingDeliveryTime",
"handlingTime": { "@type": "QuantitativeValue", "minValue": 0, "maxValue": 1, "unitCode": "DAY" },
"transitTime": { "@type": "QuantitativeValue", "minValue": 2, "maxValue": 5, "unitCode": "DAY" }
}
}
},
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "4.6",
"reviewCount": "128"
}
}
</script>
Two structural notes. price is quoted because Schema.org defines it as a text-friendly numeric value; both 199 and "199.00" validate, but the string form preserves trailing zeros exactly as merchandising wrote them. And shippingDetails is optional â add it only when the page really displays shipping terms, since mismatched metadata is exactly what manual actions are made of.
Testing, monitoring and common pitfalls
Validation is a three-step habit, not a one-time chore. First, run the Google Rich Results Test against the rendered URL (not just the raw HTML string) to confirm eligibility and catch parse errors. Second, use the Schema.org validator or the Schema Markup Validator for vocabulary-level issues that Google's tool does not flag. Third, add structured data to your release checklist: render it in a headless browser after each deploy, parse it, and fail the build if JSON parsing breaks or required fields disappear â teams lose rich results most often not to schema mistakes but to template refactors that silently drop the script block.
| Pitfall | Symptom | Fix |
|---|---|---|
| Invalid JSON | Rich Results Test reports a parse error | Quote numeric strings where types require text; escape inner quotes; use a JSON linter in CI |
| Missing visible content | Manual action for misleading structured data | Render the marked-up content in the initial HTML for all users |
| Duplicated IDs across blocks | Knowledge graph merges the wrong entities | Keep one canonical @id per entity and reference it with @id |
| Date format errors | Article previews never appear | Use ISO 8601 with timezone, for example 2026-03-14T08:00:00+05:30 |
| Relative URLs | Images and links ignored by crawlers | Always emit absolute URLs with the full origin |
| Stale ratings | Aggregate rating disagrees with visible reviews | Feed the markup from the same data source that renders the page |
Structured data is one of the few SEO disciplines where the work is entirely under your control: no backlink campaign, no content arbitrage, just accurate metadata wired to the same data your users already see. Start with Organization and BreadcrumbList on every page, add the type-specific graph where the content supports it, and keep the validation step in the pipeline so the investment does not evaporate with the next template change.
Common Mistakes
Markup for ratings, prices or FAQ content that does not appear visibly on the page
Fix: Drive JSON-LD from the same data source that renders the visible UI, and treat any divergence as a release-blocking bug.
Using relative URLs for images, item links or logo references
Fix: Emit absolute URLs including protocol and host; crawlers cannot resolve relative references reliably across every context.
Shipping JSON that only parses in the browser after client-side templating
Fix: Render the script block server-side and add a CI check that parses the final HTML with a JSON parser.
Copying an Article block into every page and changing only the headline, duplicating entity identifiers
Fix: Create each node once with a stable @id, and reference it from other blocks instead of redefining it.
Implementing exotic schema types before BreadcrumbList, Organization and the page's primary type
Fix: Cover the base graph first â it affects every URL â then layer on FAQ, HowTo or Product markup where content justifies it.
Never re-checking markup after a template redesign
Fix: Run the Rich Results Test on a sample of production URLs as part of every release checklist.
Key Takeaways
- JSON-LD is the recommended structured data format: an inert script block crawlers parse without any effect on rendering.
- Every block needs @context, an @type and properties from that type's definition; use @graph and stable @id values to link entities.
- Prioritize types with visible rich results â Article, Product, FAQPage, HowTo, BreadcrumbList and Organization cover most sites.
- Structured data must mirror visible page content; mismatched claims risk manual actions that outweigh any rich-result gain.
- Validate with the Rich Results Test and a generic schema validator, then keep parsing the rendered HTML in CI.
- Absolute URLs, ISO dates and enum values from Schema.org's vocabulary prevent the silent eligibility failures that teams hit most often.