When we talk about schema markup, we are actually talking about three possible formats for adding structured data to a web page: Microdata, RDFa, and JSON-LD. All three do the same thing — communicate to search engines what type of content the page contains — but in very different ways. Google explicitly recommends JSON-LD over the other two. Understanding why helps you implement it correctly.
The three schema markup formats
| Format | Where it is placed | Advantage | Disadvantage |
|---|---|---|---|
| Microdata | Inside HTML as tag attributes | Semantics integrated with visible content | Complicates maintenance, mixed code |
| RDFa | Inside HTML as tag attributes | Compatible with broader W3C standards | Complex syntax, rarely adopted in practice |
| JSON-LD | Independent <script> block in <head> or <body> | Code separate from HTML, easy to maintain | Not directly integrated with the visible DOM |
Why Google recommends JSON-LD
Google has officially declared its preference for JSON-LD in its technical documentation. The practical reasons are clear:
- •Separation of concerns: the schema lives in an independent <script> block, without mixing with the content HTML. This greatly simplifies maintenance and updates.
- •Dynamic injection: it can be added and modified with JavaScript without touching existing HTML, making it compatible with React, Vue, or Next.js applications.
- •Readability: it is much easier to read, write, and debug than Microdata or RDFa, where the schema is spread across all the HTML.
- •Portability: the same JSON-LD block can be copied across pages with minimal modifications.
Basic structure of a JSON-LD
Every schema.org JSON-LD follows the same basic structure: it is wrapped in a <script type="application/ld+json"> tag and inside is a JSON object with at least two properties: @context (always "https://schema.org") and @type (the entity type: Article, Product, LocalBusiness, etc.).
- •@context: always "https://schema.org" — indicates the vocabulary being used.
- •@type: the type of entity the schema describes (Article, Product, FAQPage, etc.).
- •Type-specific properties: name, description, URL, image, price, author... they depend on the chosen @type.
- •@id: optional but recommended — a unique URL that identifies the entity unambiguously.
Most commonly used types and their rich results
| @type | Rich result in Google | Implementation difficulty |
|---|---|---|
| Article / BlogPosting | Image, author, and date in AMP and Top Stories results | Low |
| Product | Stars, price, availability in product results | Medium |
| FAQPage | Expandable questions directly in the SERP | Low |
| HowTo | Numbered steps in the SERP (desktop and mobile) | Low |
| LocalBusiness | Knowledge Panel with address, hours, and ratings | Medium |
| Event | Date, location, and price in event results | Low |
| Recipe | Image, prep time, calories in recipe results | Medium |
| BreadcrumbList | Breadcrumb trail in the SERP URL display | Low |
Most common errors when implementing JSON-LD
- •Invalid JSON: an extra comma, an unclosed brace, or incorrect quotes invalidate the entire schema. Always validate with a JSON linter before publishing.
- •Missing required properties: each type has minimum required properties. Without them, Google won't activate the rich result.
- •Content that doesn't match the page: the schema must describe the actual content of the page. Incorrect prices or false ratings can result in a manual penalty.
- •Schema on the wrong pages: a Product schema on a blog page or an Article schema on a product page confuses Google.
- •Multiple conflicting schemas of the same type: if you have two Product schemas with different prices, Google picks one and may display incorrect data.
Generate your JSON-LD in seconds with AI
iRankly's AI Schema Generator analyzes your page content or the description you provide and automatically generates a valid and complete JSON-LD for the schema type you need. No syntax errors, with all fields recommended by Google.
Try the tool for free
AI Schema GeneratorAnalyze your URLs with {tool} by iRankly. No sign-up, no credit card.