Guide SEO & Marketing

How to add schema markup to your pages

Structured data that describes your page in a format search engines can parse directly, plus how to test it before it goes live.

Updated 8 min read Intermediate

Schema markup is a standardised vocabulary — maintained at schema.org — for describing what a page actually is, in a format a machine can parse without guessing. A page can say in plain text "4.5 stars, 120 reviews, £29.99", and a human reader understands that instantly; a crawler reading only the visible text has to infer the meaning. Schema markup states it directly and unambiguously.

JSON-LD is the format worth using

Schema.org's vocabulary can technically be written in a few different formats, but Google's own documentation recommends JSON-LD, and it is what the overwhelming majority of implementations use. It sits as a single self-contained script block, separate from your visible HTML, which makes it easier to add, edit and remove without touching the page's actual layout.

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Article",
  "headline": "How to Add Schema Markup to Your Pages",
  "datePublished": "2026-08-26",
  "author": {
    "@type": "Organization",
    "name": "Your Site Name"
  }
}
</script>

Every block starts with @context naming the vocabulary and @type naming which kind of thing this page describes. Everything after that is specific to the type chosen.

Choosing the right type for the page

This is the step that matters more than the syntax. Using a type that does not genuinely match the page's content is the most common way this goes wrong.

Page is aboutReasonable schema type
A blog post or news articleArticle or BlogPosting
A product for saleProduct, often with a nested Offer and AggregateRating
A physical business locationLocalBusiness
A page answering several distinct questionsFAQPage
Step-by-step instructionsHowTo
A cooking recipeRecipe

Do not add FAQPage markup to a page that is not actually structured as questions and answers, or Product markup to a page that merely mentions a product in passing. Google's guidelines are explicit that markup has to reflect content genuinely visible to a user on the page — describing something that is not there is treated as a spam signal, not a shortcut.

Markup has to match what a visitor actually sees

A rating, a price, or an availability status in your schema block that does not match what is visibly shown on the page is a direct violation of Google's structured data guidelines, and it can result in the markup being ignored across the whole site, not just the one page. Keep the two in sync whenever either one changes.

Adding it to the page

On a CMS such as WordPress, an SEO plugin will usually generate common schema types automatically from fields you already fill in — the author, the publish date, product price and stock status — with no separate markup to write by hand. For anything the plugin does not cover, or on a hand-built site, the JSON-LD block goes directly into the page's <head>, alongside your other meta tags.

Testing before it goes live

Google's Rich Results Test accepts either a live URL or pasted code and reports both syntax errors and whether the page is eligible for any enhanced result types. Run every new schema implementation through it before considering the job done — a single missing comma in JSON-LD is a silent failure that stops the entire block from being read, with no visible symptom on the page itself.

Schema Markup Validator, a separate tool also built on the schema.org vocabulary, is useful for checking markup against the full specification rather than only against what Google currently supports for rich results.

Common mistakes worth checking for

  • More than one conflicting block on the same page. A theme, a plugin and a manually added script tag can each generate their own schema for the same content, and search engines are left to guess which one to trust. Check your page source for duplicate @type declarations before assuming a single plugin is handling everything.
  • Marking up content that is hidden from visitors. Structured data describing text a visitor would have to click to reveal, or that is not on the page at all, breaks the same guideline as a mismatched rating — the data has to reflect what is genuinely visible.
  • Copying an example from elsewhere without adapting the fields. A generic example found online often needs every value replaced, not just the ones that look obviously placeholder — a leftover example URL or organisation name is easy to miss on a quick read-through.

Keeping it maintained

Structured data is not a set-and-forget addition. A product's price changes, a review count grows, an article gets updated — and the markup describing the page has to move with it. Building schema generation into your CMS or template, rather than hand-editing a static block per page, is what keeps this accurate without ongoing manual work. For background on what structured data is more broadly and where it tends to be worth the effort, see what structured data is and where it helps.

Frequently asked questions

Does adding schema markup guarantee a rich result in search?

No. Valid markup makes a page eligible to be considered for an enhanced display — a star rating, a recipe card, an FAQ dropdown — but Google decides case by case whether to actually show one, and can change its mind at any time. Markup is a precondition, not a guarantee.

Will schema markup improve my rankings?

Not directly. Google has said structured data is not itself a ranking factor. Its value is in making your content easier to parse correctly and in occasionally earning a more prominent visual result, both of which can improve click-through — but that is a different mechanism from a ranking boost.

Related reading