Developer

JSON-LD

A way to describe a page to search engines with JSON in a script tag, using schema.org types like Article or Product. It can make a page eligible for rich results in Google Search.

What a JSON-LD block holds

JSON-LD sits in a <script type="application/ld+json"> tag, in the head or the body, and it never shows on the page. A block for a post looks like {"@context":"https://schema.org","@type":"Article","headline":"PPI explained","datePublished":"2026-11-11T09:30:00Z"}. Three kinds of keys do the work. @context says which vocabulary the names come from, usually schema.org. @type says what the thing is, like Article, Product or Organization. The rest are properties of that type, like headline and datePublished, and a property such as author can hold its own object with its own @type.

In the JSON-LD specification, a context maps terms to IRIs, which are full identifiers. @id gives a thing an identifier of its own, so several pages can point at the same entity.

What Google expects

Google reads three structured data formats: JSON-LD, Microdata and RDFa. All three are fine as long as the markup is valid, and JSON-LD is the one Google marks as recommended. Its rules are short. Mark up what's visible: if the markup describes a performer, the page text has to describe that performer too. Don't block the page from Googlebot. Dates go in ISO 8601 with a time zone. For an Article, no property is required, so add the ones that apply.

Structured data can make a page eligible for rich results. Markup that breaks Google's guidelines can keep it from showing as one. Check a page with the Rich Results Test while you build it.

JSON-LD or Open Graph

They answer different questions for different readers. Open Graph tells a social app how to draw a link preview. JSON-LD tells a search engine what the page is. Most pages want both, and they don't conflict.

Because JSON-LD is JSON, a trailing comma or a comment makes the whole block invalid, so a parser can't read it. Run the block through a formatter before you publish. The JSON parse errors guide lists the usual causes.

Work it out yourselfOpen the Open Graph Visualizer

Sources

Back to the glossary