To add JSON-LD structured data, put a <script type="application/ld+json"> tag in each page's HTML containing schema.org data that describes that page: who runs the site, what the page is, and where it sits in the site. Use one main type per page, link every page to the same Person or Organization with an @id, and test it in Google's Rich Results Test. Only describe what visitors can actually see.
Every page on this site carries its own JSON-LD, generated from the same data the page renders. Below is the setup I use, the mistakes I have fixed on my own site, and a free Schema Markup Generator if you would rather not write JSON by hand.
What is JSON-LD?
JSON-LD (JavaScript Object Notation for Linked Data) is a block of JSON inside a script tag that tells search engines and AI assistants what a page is about. It sits apart from the visible HTML, so you can add or change it without touching the design.
Structured data is a description of a page written for machines. JSON-LD is the format: a block of JSON inside a script tag, using the shared schema.org vocabulary. Search engines read it to understand that a page is an article by a particular person, a service with a list of deliverables, or a business with an address and opening hours.
It does two jobs. It can make a page eligible for rich results, such as product prices or breadcrumbs in Google. And it gives answer engines, such as AI Overviews, ChatGPT and Perplexity, clean facts they do not have to infer from your prose.
Related guide: Can you add JSON-LD with Google Tag Manager?
Where do you put JSON-LD in the HTML, head or body?
You can put JSON-LD in the <head> or the <body>. Both are valid. Google's structured data guide describes JSON-LD as a script tag "in the <head> and <body> elements of an HTML page". I put it in the head.
<head>
<title>Example Accounts, CA firm in Gurugram</title>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "AccountingService",
"name": "Example Accounts",
"url": "https://www.example.com/"
}
</script>
</head>
Where the script sits matters less than how it gets there. The same Google page says Google can read JSON-LD that JavaScript adds after the page loads, which is how Google Tag Manager does it. That's true for Google. I still print the script in the HTML the server sends, for two reasons.
Other crawlers, including some AI ones, don't run JavaScript, so they never see markup that's added later. And Google's own guide to generating structured data with JavaScript warns that product markup added this way can make its Shopping crawls "less frequent and less reliable". For a store whose prices change, that's a bad trade.
On WordPress, an SEO plugin such as Yoast or Rank Math prints the script in the head for you.
Which schema types should each page use?
One main type per page, plus breadcrumbs. This is the map I use on mohitgoyal.in:
| Page | Main type | Also included |
|---|---|---|
| Home | Person | WebSite and ProfilePage, linked to the Person |
| Project page | CreativeWork | BreadcrumbList |
| Projects or tools listing | ItemList | BreadcrumbList |
| Service page | Service, with an OfferCatalog of deliverables | BreadcrumbList |
| Case study | Article, with the client as an Organization | BreadcrumbList |
| Blog post | BlogPosting | BreadcrumbList, and FAQPage when the post has an FAQ |
| Free tool page | WebApplication | HowTo, FAQPage and BreadcrumbList |
For other kinds of site the same idea applies. A restaurant or clinic home page uses LocalBusiness or a more specific subtype, a store uses Product on product pages, and an event page uses Event.
Two rules keep the map honest. First, the main type should match what a visitor would call the page: if they would call it an article, it is an Article or BlogPosting. Second, breadcrumbs should mirror the real navigation. If the breadcrumb trail in the markup says Home, Blog, Post, the page should show the same path, and every URL in it should return a 200.
How do you link pages together with @id?
Give the main entity an @id, a stable URL-like identifier, and refer to it from every other page. On this site the Person has the id https://mohitgoyal.in/#person. The WebSite says its publisher is that id, the ProfilePage says its main entity is that id, and every blog post and project names the same Person as author. For a business, the same idea joins the Organization, the WebSite, its founders and its profiles elsewhere; I cover that in how to link brand entities using JSON-LD.
The result is one connected graph instead of dozens of disconnected snippets. An engine reading any page learns that it belongs to the same site and the same person as every other page. For a business, use an Organization with an @id in the same way.
A page refers to an entity by repeating its @id. This is all a blog post needs to say who wrote it:
{
"@context": "https://schema.org",
"@type": "BlogPosting",
"headline": "Post title",
"author": { "@id": "https://mohitgoyal.in/#person" }
}
Write the full Person or Organization out once, on the home page, and other pages can point at it. I also repeat the type and the name next to the id, as in the fuller example below, so a crawler that reads only one page still gets a name.
An @id is a name. It looks like a URL, but nothing has to load at https://mohitgoyal.in/#person. What matters is that the string is identical everywhere. The mistake I'd check for first is https://example.com/#organization on one template and https://www.example.com/#organization on another. To a parser those are two different companies.
@graph is the other half. It's a list that holds several entities in one script tag, so a BlogPosting, its BreadcrumbList and the WebSite can sit together and point at each other by @id. You need it as soon as a page describes more than one thing.
What does a good JSON-LD block look like?
When a page has several entities, wrap them in an @graph array. Here is a trimmed version of the markup on a blog post:
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "BlogPosting",
"@id": "https://mohitgoyal.in/blog/example#post",
"headline": "Post title",
"datePublished": "2026-10-25",
"author": { "@type": "Person", "@id": "https://mohitgoyal.in/#person", "name": "Mohit Goyal" },
"isPartOf": { "@id": "https://mohitgoyal.in/#website" }
},
{
"@type": "BreadcrumbList",
"itemListElement": [
{ "@type": "ListItem", "position": 1, "name": "Home", "item": "https://mohitgoyal.in/" },
{ "@type": "ListItem", "position": 2, "name": "Blog", "item": "https://mohitgoyal.in/blog" }
]
}
]
}
One detail worth copying: when the JSON is printed inside a script tag, I escape every < as <. That way no text from the content, however odd, can close the script tag early and inject markup.
What does FAQPage JSON-LD look like?
FAQPage JSON-LD is one FAQPage with a mainEntity list. Each item in the list is a Question with a name (the question) and an acceptedAnswer that holds the answer text.
{
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": [
{
"@type": "Question",
"name": "Do you file GST returns for small shops?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Yes. We file monthly and quarterly GST returns for shops and traders in Gurugram."
}
},
{
"@type": "Question",
"name": "Can I pay by UPI?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Yes. We accept UPI, bank transfer and cards."
}
}
]
}
That's a made-up accounting firm, to show the shape. The questions and answers in the markup must be the same words a visitor can read on the page. Use one FAQPage per page, and give every question its own answer. I got that last part wrong on my own home page once, which is the warning further down.
Does Google still show FAQ rich results in 2026?
No. Google stopped showing FAQ rich results for every site on 7 May 2026, according to Google's Search Central changelog, and removed the FAQ rich result documentation on 15 June 2026. There are no eligibility rules left to meet.
It took three years to get here. From August 2023, Google showed the FAQ dropdowns only for well-known government and health sites, so most business sites had already lost them. The May 2026 change ended it for those sites too. FAQ has also gone from the list of types the Rich Results Test supports. I checked Google's help page for the tool in November 2026.
FAQPage is still a valid schema.org type, and old markup doesn't cause errors. Search Engine Journal reported in May 2026 that Google's notice says existing FAQ markup can stay on a page.
My view: keep FAQPage markup where the page has a real FAQ that visitors can read, because it costs almost nothing once the template generates it. Don't write an FAQ only to get the markup. I can't show you proof that ChatGPT or Google's AI answers read FAQPage data, and Google hasn't said. The visible questions and answers are what get quoted. I went through the evidence in does FAQ schema still help SEO and AI search.
How do you list services with OfferCatalog in JSON-LD?
OfferCatalog is the schema.org type for a list of things a business sells. For a service business, add hasOfferCatalog to the Service and list each service inside it as an Offer.
schema.org defines OfferCatalog as an ItemList of related Offers, and allows hasOfferCatalog on an Organization, a Person or a Service. Here is a worked example for the same made-up Gurugram accounting firm:
{
"@context": "https://schema.org",
"@type": "Service",
"@id": "https://www.example.com/services/gst#service",
"name": "GST registration and filing",
"serviceType": "GST compliance",
"areaServed": "Gurugram",
"provider": { "@id": "https://www.example.com/#organization" },
"hasOfferCatalog": {
"@type": "OfferCatalog",
"name": "GST services",
"itemListElement": [
{
"@type": "Offer",
"itemOffered": { "@type": "Service", "name": "GST registration" }
},
{
"@type": "Offer",
"itemOffered": { "@type": "Service", "name": "Monthly GST return filing" }
},
{
"@type": "Offer",
"itemOffered": { "@type": "Service", "name": "Replies to GST notices" }
}
]
}
}
The list should name the same services the page names, in the same words. Add price and priceCurrency to an Offer only if that price is printed on the page. If you quote per job, leave the price out.
Don't expect anything visible in Google from this. Service and OfferCatalog aren't in the Rich Results Test's list of supported types, so there's no service rich result to win. I add it on service pages anyway, because it states which services belong to which business in a form a machine can't misread. The provider and area fields get a full walk-through in my post on Service schema markup.
What mistakes should you avoid?
Wrong data is worse than no data
My home page used to output an FAQPage where every quick question carried the same About text as its answer. That is low-quality markup, so I removed it. If the data is not true and distinct, leave the type out.
The other mistakes I see most often:
- Marking up what is not on the page. Reviews, prices or FAQs that visitors cannot see break Google's guidelines and can cost you rich results.
- Client-side injection. JSON-LD added by a script after load may never be seen by crawlers that do not run JavaScript. Render it on the server.
- Hand-written blocks that drift. A price or address changes on the page but not in the markup. Generate the JSON-LD from the same data the page uses, so it cannot go stale.
- Several unrelated main types on one page. Pick what the page is about. A blog post is a BlogPosting, not also a Product and a LocalBusiness.
- Invented ratings. Never add an aggregateRating you cannot back up with reviews shown on the page.
Related guide: Which schema markup does a business website need?
How do you test JSON-LD?
Test JSON-LD with two free tools. Google's Rich Results Test checks the types Google shows as rich results, and the Schema Markup Validator at validator.schema.org checks any schema.org type. After launch, confirm with URL Inspection in Google Search Console.
The tools answer different questions, and mixing them up wastes an afternoon.
| Tool | What it tells you | What it won't tell you |
|---|---|---|
| Rich Results Test | Which Google rich result types it found on the page, with errors and warnings | Anything about types Google doesn't show, such as FAQPage, Service or OfferCatalog |
| Schema Markup Validator | Whether the JSON parses and the types and properties exist in schema.org | Whether Google will show a rich result |
| URL Inspection in Search Console | What Google found on the live page it crawled | Anything before the page is live |
The order I use:
- Paste the code into the Schema Markup Validator. It catches the dull breakages: a trailing comma, a curly quote copied from Word, a misspelt property.
- Run the page URL through the Rich Results Test. Google recommends the URL input over the code input when JavaScript adds the markup, because the tool then tests the page as Google renders it.
- Once the page is live, inspect the URL in Search Console and check that Google lists the same items.
If the Rich Results Test finds nothing on an FAQPage or a Service page, the markup isn't broken. Google has no rich result for those types, so check them in the validator. And a clean pass promises nothing. Google's structured data guidelines say Google "does not guarantee that your structured data will show up in search results".
How do you add JSON-LD in Next.js or WordPress?
- 1
Decide the main type per template
Use the table above. Templates, not individual pages, are what you mark up.
- 2
Generate from page data
In Next.js or TanStack Start, build the object from the same data the page renders and print it in a script tag on the server. In WordPress, use your SEO plugin's schema settings or a small plugin that reads the post's fields.
- 3
Link to your main entity
Every page refers to the same Person or Organization @id.
- 4
Test before launch
Run each template through the Rich Results Test and the Schema Markup Validator.
- 5
Watch Search Console
After launch, check the enhancement reports for errors and warnings, and fix them at the template level.
For a single page, such as a local business home page or one event, the free Schema Markup Generator writes the block for you from a plain description and never invents values. For the rest of the technical setup on a Next.js site, see my technical SEO checklist for Next.js.
Related guide: Service schema markup: how to add it for a service business
Does structured data help with AI answers?
It helps engines get your facts right, which is the first step to being quoted. Structured data is one part of that. The others are server-rendered pages, answer-first writing and consistent facts across your site, covered in how to get cited in AI Overviews. If a page has an FAQ, the free FAQ Generator drafts the questions and answers from your content, with FAQPage JSON-LD to paste.
I add schema at the template level on every site I build, and I audit and fix it on existing sites through my technical SEO and Core Web Vitals service.



