JSON-LD

JSON-LD is a way of writing linked data in JSON, the format most code already uses. On a website it sits in a script tag and describes the page's subjects, such as the business, the author, a product or an FAQ, so search engines and other software can read them without parsing the layout.

Why it matters

Google supports three formats for structured data and recommends JSON-LD, because it's the easiest to add and maintain.1 It sits apart from the visible markup, so a template change doesn't break it.

JSON-LD describes data as a graph of linked nodes, and each node can carry an @id that names it.2 That's what lets one page say "the publisher is the business described on the home page" instead of repeating every detail. Markup still has to match what readers see on the page.

In practice

  • Put one @graph per page in a single script tag.
  • Give the business, people and services permanent @id values.
  • Describe the business fully once, on the home page.
  • Match every name, price and date to the visible page.
  • Test with the Schema.org validator and Google's Rich Results Test.

What the sources say

  • A JSON-LD document is always a valid JSON document.

    W3C JSON-LD Working Group, JSON-LD 1.1

What to do about JSON-LD, depending on who you are

If you're on WordPress with an SEO plugin

The plugin already writes JSON-LD for you. The risk is a second plugin or the theme writing its own copy of your business.

  1. Fill in the plugin's organization or person settings fully.
  2. Switch off schema output in any other plugin or theme.
  3. Check one page in the Schema.org validator.

If a developer or AI tool built your site

Hand-written JSON-LD drifts as pages change. Generating it from one data file keeps every page saying the same thing.

  1. Keep the business facts in one file.
  2. Generate each page's graph from that file at build time.
  3. Test after every deploy.

Schema starter

Go deeper

My guide on how to build a schema graph has the code for a small business site. The schema starter generates the first nodes.

How to build a schema graphAll 106 terms

Sources

  1. "Introduction to structured data markup in Google Search," Google Search Central. developers.google.com
  2. "JSON-LD 1.1: A JSON-based Serialization for Linked Data," W3C Recommendation, 16 July 2020. w3.org

Related terms

Structured data

Structured data is machine-readable markup, usually JSON-LD, that tells search engines and AI tools exactly what a page is about: your organisation, services, people, prices, FAQs.

Learn the term

Schema graph

A schema graph links all the structured data on your site into one connected picture: the company, its people, services, places and pages, each with its own ID.

Learn the term

Product data for AI shopping

Product data is the structured detail behind each product: name, price, availability, specifications and reviews, marked up so machines can read it.

Learn the term

Want this done for you?

Want your structured data checked? Book a call and I'll look at it with you.

Twenty minutes and nothing to sign. The three changes are yours to keep either way.

Book a 20-minute call