How to Add JSON-LD Structured Data to Any Web Page
A step-by-step guide to adding JSON-LD schema markup: choose the type, write the script, place it in the HTML, validate it and watch for Google rich results.

JSON-LD is the format Google recommends for structured data, and it is the easiest one to add: a single <script> block that describes the page, with no changes to your visible HTML. This guide walks through the whole process, from picking a schema.org type to checking the result.
1. Decide what the page is about
Structured data describes the main thing on the page, not everything on it. A product page describes one Product. A blog post is an Article or BlogPosting. A company home page usually gets an Organization plus a WebSite. If a page is a list of things, describe the list with ItemList or leave it alone; Google ignores markup that does not match the visible content and may treat it as spam.
Start with the types that have a rich result in Google Search: Article, Product, FAQ, Breadcrumb, Recipe, Event, JobPosting, LocalBusiness, Organization, Video, Review. Markup for those types can change how your page looks in search results. Everything else is still useful for search engines but will not produce a visible snippet.
2. Write the JSON-LD block
A JSON-LD block is a plain JSON object with two special keys: @context, which is always https://schema.org, and @type, the schema.org type. Every other key is a property of that type.
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Article",
"headline": "How to Add JSON-LD Structured Data to Any Web Page",
"image": "https://example.com/images/json-ld-guide.png",
"datePublished": "2026-09-22T09:00:00+00:00",
"dateModified": "2026-09-22T09:00:00+00:00",
"author": {
"@type": "Organization",
"name": "Example Inc.",
"url": "https://example.com/"
}
}
</script>
A few rules that save hours of debugging later:
- Use real JSON. Double quotes around keys and strings, no trailing commas, no comments. Most “invalid structured data” reports are plain syntax errors.
- Match the visible page. The headline, price, rating or date in the markup must be the same as what a visitor sees.
- Use absolute URLs for
image,urland@id. Relative paths are a common source of “missing image” warnings. - Dates go in ISO 8601:
2026-09-22or2026-09-22T09:00:00+00:00. Google does not parse “22 September 2026”. - Nest related entities instead of repeating them. An
authoris anOrganizationorPersonobject, not a string.
3. Place the script in the HTML
Put the block anywhere inside <head> or <body>. Google reads it in either place. Putting it in <head> keeps it out of the way of templates and makes it easy to find. Avoid injecting it with a tag manager if you can: Google renders JavaScript, but rendering is delayed and other search engines may never run it.
If the same page has several things to describe, such as an article with breadcrumbs, you can use one script with a @graph array or several separate scripts. Both are valid. Linking entities with @id lets one block reference another, for example the article’s publisher pointing at the organization defined once.
{
"@context": "https://schema.org",
"@graph": [
{ "@type": "Organization", "@id": "https://example.com/#org", "name": "Example Inc.", "url": "https://example.com/" },
{ "@type": "Article", "headline": "…", "publisher": { "@id": "https://example.com/#org" } }
]
}
4. Validate before you publish
Check three things, in this order:
- Syntax. Is the JSON well-formed? A single missing comma invalidates the whole block.
- Vocabulary. Do the types and properties exist in schema.org, and are the values of the expected kind?
datePublishedwants a date,pricewants a number,imagewants a URL. - Google requirements. Does the type have everything Google requires for its rich result? For Article that means
headline,image,datePublishedand anauthorwith aname; Google’s documentation lists the required and recommended properties per type.
The Schema Markup Checker does all three on one page and points at the exact line of the problem. For a whole site, the site scan crawls every page and lists the issues grouped by type, which is how you find the one template that has a broken field across hundreds of URLs.
5. Watch the results
After publishing, request indexing in Google Search Console and look at the Enhancements reports a few days later. They show which pages have valid markup, which have warnings and which have errors. Rich results are never guaranteed, even for perfect markup, but errors reliably prevent them.
Keep the markup in sync with the page. The most common way structured data breaks is not a typo but a redesign that changes the price element or the author field while the JSON-LD template keeps the old value. Scheduling a scan after every release catches that before Search Console does.