How to Use Schema Markup

Validate your schema markup before publishing!

Validate Schema Markup →

Introduction

Implementing schema markup on your website is easier than you might think. With JSON-LD (Google's recommended format), you can add structured data to any page without touching your existing HTML content.

This step-by-step guide will walk you through the entire process, from choosing the right schema type to validating and deploying your markup. Whether you're working with WordPress, Shopify, custom HTML, or any other platform, these steps apply universally.

Step 1: Identify Your Content Type

The first step is determining what type of content you're marking up. Schema.org defines hundreds of types, but here are the most common ones:

For E-commerce Sites:

For Content Publishers:

For Local Businesses:

For Events & Entertainment:

For Informational Pages:

Pro tip: Visit Schema.org to explore the full list of schema types and find the perfect match for your content.

Step 2: Choose JSON-LD Format (Recommended)

Google recommends using JSON-LD for schema markup because it's:

Basic JSON-LD Structure

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "YourSchemaType",
  "property1": "value1",
  "property2": "value2"
}
</script>

Where to Place JSON-LD

You can place JSON-LD schema markup in three locations:

  1. In the <head> section (most common) – Loads early, easy to find
  2. In the <body> section – Also valid, sometimes used in CMS templates
  3. At the end of <body> – Works fine but less common

Recommendation: Place it in the <head> section for consistency.

Step 3: Generate Your Schema Code

Now it's time to create your actual schema markup. You have three options:

Option A: Write It Manually

If you're comfortable with JSON, you can write schema markup from scratch using Schema.org documentation as reference. This gives you complete control and is great for custom implementations.

Option B: Use a Schema Generator

Schema generators are tools that create JSON-LD code for you. You fill in a form with your content details, and the tool outputs ready-to-use schema code.

Popular generators: Schema Markup Generator, TechnicalSEO.com tools, Merkle's Schema Generator

Option C: Use a WordPress Plugin

If you're using WordPress, plugins like Rank Math, Yoast SEO, and Schema Pro can automatically generate schema markup for your content.

Essential Properties to Include

Every schema type has required properties and recommended properties:

Step 4: Add Code to Your Website

Once you have your schema markup code, you need to add it to your website. The method depends on your platform:

For HTML Websites:

  1. Open your page's HTML file in a text editor
  2. Locate the <head> section
  3. Paste your JSON-LD code before the closing </head> tag
  4. Save and upload the file to your server

For WordPress:

  1. Install a plugin like "Insert Headers and Footers" or "Code Snippets"
  2. Paste your JSON-LD code in the header section
  3. Or use theme customizer → Additional CSS/Scripts
  4. Save and publish

For Shopify:

  1. Go to Online Store → Themes → Actions → Edit Code
  2. Open theme.liquid file
  3. Add your JSON-LD code in the <head> section
  4. Save changes

For Other CMS Platforms:

Most modern CMS platforms (Wix, Squarespace, Webflow, etc.) allow you to add custom code to page headers. Look for settings like:

Important Rules:

Step 5: Validate Your Schema

This is the most critical step! Never publish schema markup without validating it first. Invalid markup can:

Validation Tools:

1. Google Rich Results Test (Most Important)

URL: search.google.com/test/rich-results

This tool shows exactly how Google interprets your schema and whether you're eligible for rich results. It's the gold standard for validation.

2. Schema Markup Validator

Use a comprehensive schema validator to check all schema types and catch any errors Google's tool might miss.

3. Schema.org Validator

URL: validator.schema.org

Official validator that checks compliance with Schema.org standards.

What to Check:

Step 6: Monitor and Maintain

After publishing your schema markup, ongoing monitoring is essential:

Use Google Search Console

  1. Add your site to Google Search Console (if not already added)
  2. Navigate to "Enhancements" section
  3. Check structured data reports for your schema types
  4. Monitor for errors, warnings, and valid items
  5. Track rich results performance and impressions

Regular Maintenance Tasks:

When to Update Schema:

Common Mistakes to Avoid

1. Duplicate Schema Items

Problem: Adding the same schema type multiple times on one page.

Solution: Use one comprehensive schema instance per content item. If you have multiple products, use a separate Product schema for each, but don't duplicate schemas for the same product.

2. Wrong Field Names

Problem: Using incorrect property names (e.g., "title" instead of "name").

Solution: Always reference Schema.org documentation for exact property names. Property names are case-sensitive and must be spelled exactly as defined.

3. Missing Required Fields

Problem: Omitting required properties causes validation errors.

Solution: Check Schema.org docs for required properties. For Product schema, "name" is required. For Event, "name" and "startDate" are required.

4. Invalid Data Types

Problem: Using a string where a number, date, or URL is expected.

Solution: Follow proper formatting:

5. Mismatched Content

Problem: Schema describes content not visible on the page.

Solution: Schema must reflect actual page content. If your page says "Price: $29.99", your schema should also say 29.99. Don't mark up content that doesn't exist.

6. Outdated Information

Problem: Schema shows old prices, dates, or availability.

Solution: Update schema whenever content changes. For dynamic content, consider automating schema generation.

7. Invisible Content Markup

Problem: Marking up content hidden from users (hidden divs, accordion content).

Solution: Only mark up content visible to users. Google may penalize sites that mark up hidden content.

8. JSON Syntax Errors

Problem: Missing commas, brackets, or quotes break the entire schema.

Solution: Use a JSON validator or code editor with syntax highlighting. Common mistakes:

Quick Checklist for Success

Use this checklist every time you implement schema markup:

Validate your schema markup now! Test your structured data before publishing to ensure it's error-free and eligible for rich results.

Validate Schema Markup →