JSON-LD
Definition: JSON-LD (JavaScript Object Notation for Linked Data) is a format for adding structured data to a page inside a script tag, separate from the visible HTML; it is the format Google recommends for schema.org markup.
Also called: JSON for Linked Data, application/ld+json
Updated
What it looks like
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Organization",
"@id": "https://example.com/#organization",
"name": "Example Co",
"url": "https://example.com",
"logo": "https://example.com/logo.png",
"sameAs": ["https://www.linkedin.com/company/example-co"]
}
</script>
The @context names the vocabulary, @type says what is being described and the remaining properties describe it. JSON-LD is a W3C standard (JSON-LD 1.1).
Why it is the preferred format
Microdata and RDFa weave attributes into the visible HTML, so markup and design changes get tangled. JSON-LD sits in its own block, which makes it easier to generate from a database or CMS, to review and to test. Google says it recommends JSON-LD for structured data (Introduction to structured data).
It also lets you connect nodes. Giving the Organization an @id lets your Article markup refer to it as the publisher instead of repeating every property, and several nodes can share one @graph array.
Errors that make it useless
- Invalid JSON: a trailing comma or an unescaped quote breaks the whole block silently.
- Describing content that is not on the page, such as reviews or prices users cannot see.
- Injecting it with JavaScript after load. Google can read it once it renders the page, but crawlers that do not run JavaScript, including most AI crawlers, never see it. Output it in the server-rendered HTML.
- Duplicate, conflicting nodes, for example two Organization blocks with different names from a theme and a plugin.
Check syntax and required properties with the schema markup validator.