How to Add JSON-LD Structured Data (With Copy-Paste Examples)
What Is JSON-LD?
JSON-LD (JavaScript Object Notation for Linked Data) is Google's preferred format for structured data. It tells search engines what your page is about in a machine-readable way.
Why Add Structured Data?
Pages with structured data can show **rich results** in Google:
- ⭐ Star ratings
- 📋 FAQ accordions
- 🍳 Recipe cards
- 📅 Event dates
- 💰 Product prices
- 🔍 Sitelinks search box
Rich results get 20-30% higher click-through rates.
Copy-Paste Templates
WebPage (Any Page)
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebPage",
"name": "Your Page Title",
"description": "Your page description",
"url": "https://yoursite.com/page"
}
</script>
Article (Blog Post)
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Article",
"headline": "Your Article Title",
"description": "Article summary",
"author": {"@type": "Person",
"name": "Author Name"
},
"datePublished": "2026-03-22",
"dateModified": "2026-03-22",
"publisher": {"@type": "Organization",
"name": "Your Site Name"
}
}
</script>
FAQ Page
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": [
{"@type": "Question",
"name": "What is SEO?",
"acceptedAnswer": {"@type": "Answer",
"text": "SEO (Search Engine Optimization) is the practice of improving your website to increase visibility in search results."
}
},
{"@type": "Question",
"name": "How long does SEO take?",
"acceptedAnswer": {"@type": "Answer",
"text": "SEO typically takes 3-6 months to see significant results, depending on competition and effort."
}
}
]
}
</script>
Product
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Product",
"name": "Product Name",
"description": "Product description",
"offers": {"@type": "Offer",
"price": "29.99",
"priceCurrency": "USD",
"availability": "https://schema.org/InStock"
}
}
</script>
Organization
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Organization",
"name": "Your Company",
"url": "https://yoursite.com",
"logo": "https://yoursite.com/logo.png",
"sameAs": [
"https://twitter.com/yourhandle",
"https://linkedin.com/company/yourcompany"
]
}
</script>
Where to Add JSON-LD
Add the `<script>` tag in your HTML `<head>` or at the end of `<body>`. Google reads it regardless of position.
**In Next.js:**
// app/layout.tsx
<script type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(schema) }}/>
**In WordPress:**
Use Yoast SEO or Rank Math plugin — they auto-generate schema.
Validation
- [Google Rich Results Test](https://search.google.com/test/rich-results)
- [Schema.org Validator](https://validator.schema.org/)
- [SEO Snapshot](/) — validates JSON-LD and checks required fields
FAQ
**Q: Does structured data improve rankings?**
A: Not directly. But rich results increase CTR, which indirectly helps rankings.
**Q: Can I have multiple JSON-LD scripts on one page?**
A: Yes. Google recommends one script per entity but supports multiple.
**Q: What happens if my schema has errors?**
A: Google ignores invalid schema. It won't hurt rankings but you miss rich result opportunities.
Check your site's SEO score for free
Analyze your site