What is Schema Markup?
Schema markup is structured data code that you add to your website to help search engines understand your content. It uses a standardised vocabulary from Schema.org and is typically written in JSON-LD format, a small block of code placed in your page's <head> tag.
When Google reads your schema, it can display rich results in search-enhanced listings that show star ratings, FAQ dropdowns, prices, cooking times, and more. These rich results take up more space on the page and attract significantly higher click-through rates than standard blue links.
Step 1: Choose the Right Schema Type
The first step is picking the right schema type for your page. Different pages need different schema. Here's a quick reference:
| Page type | Schema to use | Rich result |
|---|---|---|
| Blog post / article | Article / BlogPosting | Author byline, date |
| FAQ page or section | FAQPage | Expandable Q&A dropdowns |
| Product page | Product | Price, availability, ratings |
| Business homepage | LocalBusiness | Maps, knowledge panel |
| Recipe page | Recipe | Cook time, calories, ratings |
| How-to guide | HowTo | Step-by-step panel |
| Review page | Review | Star ratings |
| Any page (navigation) | BreadcrumbList | Navigation path in URL |
Step 2: Generate Your JSON-LD Code
Writing JSON-LD by hand is error-prone and time-consuming. The easiest approach is to use a free generator, fill in a form, and get a valid code instantly.
Generate Schema in Seconds
Free JSON-LD generators for every schema type. No signup required.
Once you've generated your schema, copy the full output. It looks like this:
<script type="application/ld+json"> { "@context": "https://schema.org", "@type": "FAQPage", "mainEntity": [ { "@type": "Question", "name": "What is schema markup?", "acceptedAnswer": { "@type": "Answer", "text": "Schema markup is code you add to your website to help search engines understand your content." } } ] } </script>
Step 3: Add the Code to Your Website
Now paste the JSON-LD into your page. The method depends on your platform:
For plain HTML websites, paste the JSON-LD code directly inside the <head> tag of your page before the closing </head> tag.
<html> <head> <title>Your Page Title</title> <!-- Paste your schema here --> <script type="application/ld+json"> { "@context": "https://schema.org" ... } </script> </head> <body>...
The schema code is invisible to visitors; it only exists for search engines. You can add multiple schema blocks in the same <head> tag.
There are two easy ways to add schema in WordPress:
- Using Rank Math (recommended): Install the free Rank Math SEO plugin → go to the page/post editor → find the "Schema" tab in Rank Math's sidebar → select your schema type and fill in the details. Rank Math generates the JSON-LD automatically.
- Using a custom code plugin: Install "Insert Headers and Footers" or "WPCode" → paste your JSON-LD into the header section → save. The code will be added to every page, or you can add it per-page.
- Using your theme's functions.php: Advanced users can add schema via
wp_head()hook in functions.php. Only recommended if you're comfortable with PHP.
To add schema markup to a Shopify store:
- Go to your Shopify Admin → Online Store → Themes
- Click "Customize" next to your active theme
- Click "Edit code" (or go to Actions → Edit code)
- Open Layout → theme.liquid
- Find the closing
</head>tag and paste your JSON-LD just before it - Click Save
To add schema markup in Wix:
- Go to your Wix Dashboard → Settings → Advanced → Custom Code
- Click "+ Add Custom Code"
- Paste your JSON-LD schema code in the code box
- Set Place Code to "Head"
- Choose which pages to apply it to select specific pages for page-specific schema
- Click Apply and publish your site
Step 4: Validate Your Schema
Before you publish, always validate your schema. This catches errors before Google finds them and ensures you're eligible for rich results.
Visit schemify.in/validator, Schemify's free built-in schema validator. No signup or external tools needed.
Copy your generated JSON-LD and paste it directly into the Schemify Validator. It instantly detects your schema type and checks for errors.
The validator shows your schema type, highlights any errors or missing fields, and confirms whether your markup is valid. Fix any errors shown before publishing.
Once validated, paste the code into your page's <head> tag and publish. Then check Google Search Console → Enhancements to monitor rich results. It typically takes a few days to a few weeks for rich results to appear.
Common Mistakes to Avoid
Frequently Asked Questions
Free Schema Generators
Use these free tools to generate valid JSON-LD for any content type: