← CodeClarityLab Home
Browse by Category
+ added · updated 7d
← Back to glossary

Structured Data — JSON-LD

frontend Intermediate

Also Known As

JSON-LD schema markup structured data schema.org rich snippets rich results ld+json

TL;DR

Machine-readable schema markup embedded in a <script type='application/ld+json'> block, enabling Google rich results — star ratings, FAQs, breadcrumbs, events, and recipes in search.

Explanation

Structured data communicates page content meaning to search engines in a formal vocabulary (Schema.org). JSON-LD (JavaScript Object Notation for Linked Data) is Google's preferred format — it lives in a <script> tag in <head> or <body>, separate from visible HTML, making it easy to add and maintain without modifying markup. Common schema types: WebPage (any page), Article (blog posts), Product (e-commerce with price, rating, availability), FAQPage (FAQ sections shown as expandable results), BreadcrumbList (site navigation path), Event (concerts, webinars), LocalBusiness (address, hours, phone). Valid structured data enables rich results in Google Search which typically increase CTR by 20–30%. Google requires the information in structured data to also appear visibly on the page — hidden data is ignored or penalised.

Common Misconception

Structured data directly improves search rankings — it enables rich results (which improve CTR) but is not a direct ranking factor; a page with perfect structured data but poor content will not outrank a page with excellent content.

Why It Matters

A recipe page with Recipe schema gets star ratings, cook time, and ingredients shown directly in search results — compared to a plain blue link, these rich results consistently achieve higher click-through rates and more qualified traffic.

Common Mistakes

  • Structured data describing content that doesn't appear on the page — Google requires visible corroboration for all structured data claims.
  • Invalid JSON syntax in the ld+json block — a single missing comma or unclosed bracket silently breaks the entire schema.
  • Using Microdata or RDFa instead of JSON-LD — all three formats work, but JSON-LD is easiest to maintain and Google's explicit recommendation.
  • Applying Product schema without price and availability — incomplete Product schema is not eligible for rich results.
  • Not testing with Google's Rich Results Test — schema that validates against Schema.org may still be ineligible for rich results due to Google-specific requirements.

Avoid When

  • Do not add structured data for content that is not visibly present on the page — Google penalises hidden or misleading markup.
  • Do not use for content that changes frequently without updating the schema — stale structured data (outdated prices, sold-out products marked available) can trigger manual actions.

When To Use

  • Add structured data to any page type that has a matching Schema.org type with Google rich result support.
  • Priority order: Product (e-commerce), Recipe, FAQPage, Article, LocalBusiness, Event, BreadcrumbList.
  • Always test with Google's Rich Results Test before publishing to confirm eligibility.

Code Examples

✗ Vulnerable
<!-- No structured data — Google generates generic snippet -->
<head>
  <title>Chocolate Chip Cookie Recipe</title>
</head>
<body>
  <h1>Best Chocolate Chip Cookies</h1>
  <p>Rating: 4.8/5 from 243 reviews</p>
</body>
✓ Fixed
<head>
  <title>Chocolate Chip Cookie Recipe</title>
  <script type="application/ld+json">
  {
    "@context": "https://schema.org",
    "@type": "Recipe",
    "name": "Best Chocolate Chip Cookies",
    "aggregateRating": {
      "@type": "AggregateRating",
      "ratingValue": "4.8",
      "reviewCount": "243"
    },
    "totalTime": "PT35M",
    "recipeYield": "24 cookies"
  }
  </script>
</head>

Added 6 Apr 2026
Views 13
Rate this term
No ratings yet
🤖 AI Guestbook educational data only
| |
Last 30 days
0 pings W 0 pings T 1 ping F 0 pings S 0 pings S 1 ping M 2 pings T 0 pings W 0 pings T 0 pings F 0 pings S 1 ping S 0 pings M 0 pings T 0 pings W 0 pings T 0 pings F 0 pings S 0 pings S 0 pings M 0 pings T 0 pings W 1 ping T 1 ping F 1 ping S 0 pings S 1 ping M 0 pings T 0 pings W 0 pings T
No pings yet today
No pings yesterday
Google 6 Perplexity 2 ChatGPT 1 Ahrefs 1
crawler 9 crawler_json 1
DEV INTEL Tools & Severity
🟢 Low ⚙ Fix effort: Medium
⚡ Quick Fix
Add <script type='application/ld+json'> with appropriate Schema.org type to <head>; validate with Google's Rich Results Test
📦 Applies To
html web
🔍 Detection Hints
Missing <script type='application/ld+json'> in page source
Auto-detectable: ✓ Yes google-rich-results-test screaming-frog schema-markup-validator
⚠ Related Problems
🤖 AI Agent
Confidence: High False Positives: Low ✗ Manual fix Fix: Medium Context: File

✓ schema.org compliant