Blog Add JSON-LD structured data to any page
Add JSON-LD structured data to any page
TL;DR JSON-LD is a script tag that describes your page in schema.org terms. Add one describing what the page is (Article, FAQPage, BreadcrumbList, Person), keep it consistent with the visible content, and search and AI engines can parse it directly. Validate it before you ship.
Structured data is how you stop making search engines guess. Instead of inferring what your page is from the HTML, you tell them directly, in a format built for machines. JSON-LD is the cleanest way to do it, and adding it takes minutes.
What JSON-LD actually is
It is a block of JSON inside a script tag:
<script type="application/ld+json">
{ "@context": "https://schema.org", "@type": "Article", "headline": "..." }
</script>
The @context points at schema.org's vocabulary, and @type says what the thing is. Search engines and AI answer engines read this to understand the page without parsing your layout.
Pick the type that fits
Use the schema.org type that matches the page.
- Article or BlogPosting for posts, with
headline,datePublished, andauthor. - FAQPage for a real FAQ section, with each question and answer.
- BreadcrumbList for the path to the page.
- Person or Organization for an about or profile page.
A blog post often carries several at once: the article, its breadcrumb, and its FAQ.
A worked example
Here is a minimal BlogPosting:
{
"@context": "https://schema.org",
"@type": "BlogPosting",
"headline": "Add JSON-LD structured data to any page",
"datePublished": "2026-10-01",
"author": { "@type": "Person", "name": "Gunjan Jaswal" },
"mainEntityOfPage": "https://www.gunjanjaswal.me/blog/add-json-ld-structured-data"
}
Render it server-side so it is in the initial HTML, not injected later.
The rules that keep it working
- Match the visible content. Only describe what is actually on the page. Marking up hidden or invented content invites a penalty.
- Keep IDs consistent. If you reference a Person across pages, give it a stable
@idso engines connect them. - Validate before shipping. Run the markup through a structured-data validator and fix warnings. A single malformed block can void the rest.
Why it is worth the few minutes
Clean structured data is what lets AI answer engines quote you with confidence and makes your pages eligible for rich results. It pairs naturally with writing that leads with the answer. For the wider approach, see my note on Answer Engine Optimization.
FAQ
What is JSON-LD?
It is a way to embed structured data as a block of JSON inside a script tag with type application/ld+json. It describes your page using schema.org vocabulary, so machines can understand what the page is about without guessing from the HTML.
Does structured data improve rankings?
It does not directly boost rankings, but it makes pages eligible for rich results and easier for AI answer engines to quote accurately. That can improve click-through and citations, which matter more than a raw ranking bump.
What happens if the structured data does not match the page?
Search engines can ignore it or flag it as spammy. Structured data must describe what is actually on the page. Marking up content that is not visible, or claiming a rating you do not show, is a good way to lose trust.