What is JSON-LD?

JSON-LD stands for JavaScript Object Notation for Linked Data. It is a W3C standard for writing structured data as JSON, and it is the format Google recommends for adding schema markup to web pages. The data sits in a <script type="application/ld+json"> block, separate from the visible HTML.

That separation is its main advantage. With Microdata or RDFa, you add attributes to the HTML elements themselves, so markup breaks when a template changes. JSON-LD can be generated and maintained in one place without touching the page layout.

How it works

A JSON-LD block has a few special keys:

  • @context names the vocabulary, almost always https://schema.org.
  • @type sets the thing being described, such as Article, Product, or Organization.
  • @id gives a node a unique identifier (usually a URL with a fragment) so other nodes can refer to it.
  • @graph holds several connected nodes in one block.

Everything else is a property from the vocabulary. Values can be text, numbers, URLs, or nested objects. Nesting and @id references let you express relationships: this Article was published by that Organization, which is also the publisher of this WebSite.

JSON-LD can appear in the head or body, and a page can have more than one block. Google can read JSON-LD injected by JavaScript, but server-rendered markup is more reliable and is read by crawlers that do not execute scripts.

Example

html
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@graph": [
    {
      "@type": "Organization",
      "@id": "https://example.com/#org",
      "name": "Kiln Coffee",
      "url": "https://example.com/",
      "logo": "https://example.com/logo.png"
    },
    {
      "@type": "Article",
      "headline": "How to Brew Pour-Over Coffee",
      "datePublished": "2026-09-12",
      "publisher": { "@id": "https://example.com/#org" }
    }
  ]
}
</script>

In WordPress

SEO plugins generate JSON-LD from post data so you rarely write it by hand. Hydrogen SEO prints one server-rendered JSON-LD block per page, with no front-end JavaScript, and developers can adjust it with the hydrogen_seo_schema_markup filter. See the schema markup overview. The hydrogenseo.com platform also has a standalone schema generator for any site.

Common mistakes

  • Invalid JSON: trailing commas, smart quotes pasted from a word processor, unescaped quotes in text.
  • Values that contradict the page, such as a price or date that differs from what visitors see.
  • Several disconnected blocks describing the same entity with different names.

Common questions

Is JSON-LD better than Microdata?

For most sites, yes. Google supports both, but JSON-LD is easier to generate, maintain, and validate because it is separate from the HTML.

Where should JSON-LD go on the page?

Either the head or the body works. Placing it in the head in the server-rendered HTML is the most common and reliable choice.