Home / Blog / Schema and Structured Data / How do I do schema markup?
Schema

How do I do schema markup?

23 June 2026 ยท By John Carlsson
Write the schema as JSON-LD, using the vocabulary from schema.org, inside a script tag of type application/ld+json in the page's head. Choose the type that fits the page, such as Article, Product or LocalBusiness, and fill in its properties from what is visible on the page. Then test it with Google's Rich Results Test.
Schema markup is structured data added to your website that helps search engines better understand your content. The most widely recommended way to do schema markup is JSON-LD, embedded as a script tag within the HTML head section. You define the markup using vocabulary from schema.org, specifying things like article authors, product prices, review ratings, or business details. After adding it, use Google's Rich Results Test or the Schema Markup Validator to verify it is valid and correctly interpreted.

The simplest way to do schema markup without a developer

If you want to do schema markup yourself, JSON-LD (JavaScript Object Notation for Linked Data) is the recommended format because it lives as a separate, self-contained code block in the page's head section, rather than being woven into the HTML of the visible content.

This means you can add or modify schema without touching the page's actual content, making it easier to implement and maintain for non-developers. In most content management systems, there's either a dedicated 'Custom Code' or 'Header Injection' field where you can paste a JSON-LD block, or a plugin that handles it through a user interface without requiring you to write code at all.

Writing your first schema block: a practical example

For a simple Article page, the minimum JSON-LD looks like this: you open a script tag with type='application/ld+json', write an object identifying the @type as 'Article', then provide fields like headline (the article title), datePublished (the publication date in ISO format), author (the name of the author), and publisher (your organisation name with a logo). You close the script tag. That's a valid, functional Article schema block. The AI Schema Generator on aiwebpageseo.com can create this automatically from any URL, removing the need to write it manually.

Validating your schema before going live

Never deploy schema markup to a live page without validating it first. Common mistakes that look fine on the surface but break the structured data include: dates formatted incorrectly (schema expects 2026-06-26, not 26/06/2026), prices formatted with a currency symbol when schema expects a number, and required properties simply missing because they weren't included. Google's Rich Results Test (search for it in Google) lets you paste your JSON-LD or enter a URL and immediately shows whether it's valid and whether the page qualifies for rich results. This test takes under a minute and prevents shipping broken schema.

Key Takeaways

Related Questions

Frequently asked questions

Why is JSON-LD the recommended way to do schema markup?

JSON-LD, short for JavaScript Object Notation for Linked Data, is recommended because it sits as a separate, self-contained code block in the page's head section rather than being woven into the HTML of the visible content. This means you can add or change schema without touching the page's actual content, which makes it easier for non-developers to implement and maintain. Most content management systems offer either a custom code or header injection field where a JSON-LD block can be pasted, or a plugin that handles schema through a user interface without any coding.

What does a basic Article schema block include?

A minimal Article schema in JSON-LD starts with a script tag whose type is application/ld+json. Inside it, you write an object with the @type set to Article, then provide fields such as headline for the article title, datePublished for the publication date in ISO format, author for the author's name, and publisher for your organisation name with a logo. Closing the script tag completes a valid, functional Article schema block. The AI Schema Generator on aiwebpageseo.com can create this automatically from any URL, removing the need to write it by hand.

How do I validate schema markup before publishing?

Never deploy schema markup to a live page without validating it first. Common mistakes look fine on the surface but break structured data, such as dates in the wrong format (schema expects 2026-06-26, not 26/06/2026), prices that include a currency symbol when schema expects a number, and required properties left out entirely. Google's Rich Results Test lets you paste your JSON-LD or enter a URL and immediately shows whether the markup is valid and whether the page qualifies for rich results. It takes under a minute and prevents broken schema from being shipped.

๐Ÿ’ฌ Got a problem?

aiwebpageseo.com is a data-driven SEO and AEO platform providing a free suite of technical website tools.