Structured data with JSON-LD
Structured data is a machine-readable description of what a page is about: this page is a product
with this price, this is an article by this author, this is a local business with these opening
hours. It uses the schema.org vocabulary, and the format Google recommends is
JSON-LD, a <script> block in the page:
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Organization",
"name": "Example Ltd",
"url": "https://example.com",
"logo": "https://example.com/logo.png"
}
</script>
Why it matters
Search engines can read most pages without help, but structured data removes guesswork. Google uses it to make pages eligible for rich results: product details with price and availability, recipe cards, event listings, breadcrumbs, review stars and more.
Two things to keep in mind:
- Structured data makes a page eligible for rich results. It does not guarantee them, and it is not a general ranking boost.
- The markup must describe content that is actually visible on the page. Markup that misrepresents the page breaks Google’s structured data guidelines and can lead to a manual action.
What we check
We find every <script type="application/ld+json"> block in the HTML and try to parse each one as
JSON.
| Result | When |
|---|---|
| Pass | at least one block exists and every block parses |
| Needs attention | there are no JSON-LD blocks |
| Fail | at least one block is not valid JSON |
The report lists the @type values we found (including those inside @graph) and how many blocks
failed to parse.
This is a syntax check. We do not validate the content against schema.org or against Google’s requirements for specific rich result types. We also only look for JSON-LD: structured data written as Microdata or RDFa is not detected and the check will report that none was found.
How to fix
No JSON-LD. Pick the schema.org type that matches the page and add a block to the <head> or
<body>. Good starting points:
| Page | Type |
|---|---|
| Home page | Organization and/or WebSite |
| Blog post or news story | Article or BlogPosting |
| Product page | Product with an Offer |
| Local shop or office | LocalBusiness (or a subtype) |
| Any page in a hierarchy | BreadcrumbList |
Fill in the properties Google lists as required for that type, then the recommended ones you can support with real data.
Invalid JSON. A single syntax error makes the whole block unreadable. The usual causes:
- a trailing comma after the last property or array item;
- single quotes instead of double quotes around keys or strings;
- unescaped double quotes or line breaks inside a string value;
- HTML comments or template tags left inside the block;
- a CMS or plugin printing two objects back to back without wrapping them in an array.
Paste the block into any JSON validator to find the exact line. When you generate JSON-LD in code,
build an object and serialize it (for example JSON.stringify in JavaScript or json_encode in
PHP) instead of assembling the string by hand. Also escape < in values, so a string containing
</script> cannot end the block early.
Several entities on one page. Use one block with @graph, or several blocks. Both are valid.
{
"@context": "https://schema.org",
"@graph": [
{ "@type": "WebSite", "name": "Example", "url": "https://example.com" },
{ "@type": "Organization", "name": "Example Ltd", "url": "https://example.com" }
]
}
Test before you ship
Run important templates through Google’s Rich Results Test to check that the type is recognized and required properties are present. After launch, Search Console reports structured data errors per type across your site.
Google’s introduction to structured data lists the supported rich result types and their requirements.