Schema Markup for WordPress: The Complete 2026 Setup Guide
Last Updated: February 25, 2026 · 14 min read
WordPress powers 43% of all websites — and it has one of the messiest schema markup ecosystems on the web. You have your theme adding schema, Yoast adding schema, WooCommerce adding schema, and possibly a third plugin adding more. The result: duplicate structured data, errors in Google Search Console, and rich results that never appear. This guide fixes all of it.
⚠️ The #1 WordPress schema problem
Most WordPress sites have at least 2 sources of schema markup competing with each other. Before adding anything new, audit what is already on your pages. Use View Source or our validator on your URL.
1. Plugin Comparison: Which Should You Use?
Yoast SEO
Most popularPros
- ✓Auto-generates Article, WebPage, BreadcrumbList
- ✓Integrates with WooCommerce for Product schema
- ✓Easy configuration via SEO meta box
- ✓Actively maintained
Cons
- ✗Limited schema types without Premium
- ✗Cannot easily add custom schema types
- ✗Premium costs ~$99/year per site
Best for: Blogs, news sites, simple business sites
RankMath
Best free optionPros
- ✓More schema types free (FAQ, HowTo, Recipe, Event)
- ✓Schema builder UI in post editor
- ✓WooCommerce + EDD integration
- ✓Lower cost than Yoast Premium
Cons
- ✗Feature-heavy — can feel complex
- ✗Some advanced features locked in Pro
Best for: Most WordPress sites — best free schema coverage
Schema Pro
Best for custom schemaPros
- ✓16+ schema types out of the box
- ✓Page-level and site-level schema mapping
- ✓Works alongside Yoast/RankMath
- ✓One-time pricing option
Cons
- ✗Paid only (~$79/year)
- ✗You need a separate SEO plugin for meta tags
Best for: E-commerce, service businesses, local businesses needing precise schema
2. Adding Custom JSON-LD Without a Plugin
Sometimes you need schema a plugin cannot generate. The cleanest method is a small code snippet in functions.php or a code snippets plugin:
// Add to functions.php or a Code Snippets plugin:
function my_custom_schema() {
// Only on single posts
if ( ! is_singular('post') ) return;
$schema = [
'@context' => 'https://schema.org',
'@type' => 'BlogPosting',
'headline' => get_the_title(),
'datePublished' => get_the_date('c'),
'dateModified' => get_the_modified_date('c'),
'url' => get_permalink(),
'author' => [
'@type' => 'Person',
'name' => get_the_author(),
],
'publisher' => [
'@type' => 'Organization',
'name' => get_bloginfo('name'),
],
];
echo '<script type="application/ld+json">'
. wp_json_encode($schema)
. '</script>';
}
add_action('wp_head', 'my_custom_schema');3. WooCommerce Product Schema
WooCommerce adds basic Product schema automatically, but it often lacks star ratings. Here is what complete WooCommerce Product schema should include:
{
"@context": "https://schema.org",
"@type": "Product",
"name": "Premium Widget",
"image": "https://example.com/widget.jpg",
"description": "High-quality widget for all purposes",
"sku": "WGT-001",
"brand": { "@type": "Brand", "name": "MyBrand" },
"offers": {
"@type": "Offer",
"price": "29.99",
"priceCurrency": "USD",
"availability": "https://schema.org/InStock",
"url": "https://example.com/products/premium-widget"
},
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "4.7",
"reviewCount": "143"
}
}Note: Yoast + WooCommerce generates most of this. To add aggregateRating, install a review plugin like WP Product Review or WooCommerce Reviews and ensure reviews are displayed on the page.
4. Fixing Duplicate Schema in WordPress
🚩 Problem: Theme + Yoast both outputting Organization schema
✅ Fix: Disable schema output in your theme. Look for "Disable Schema" or "Structured Data" in your theme settings. Theme schema is almost always lower quality than Yoast's.
🚩 Problem: Two plugins outputting conflicting breadcrumb schema
✅ Fix: In Yoast: go to SEO → Search Appearance → Breadcrumbs and check the output. Disable breadcrumb schema in the plugin that is not your primary SEO plugin.
🚩 Problem: WooCommerce + Yoast both creating Product schema
✅ Fix: Install the official Yoast WooCommerce SEO plugin. It is designed to merge both, replacing duplicate schema with a single unified output.
🚩 Problem: Old AIO SEO / All in One schema conflicting with RankMath
✅ Fix: When migrating from one SEO plugin to another, always disable and deactivate the old plugin completely before enabling the new one.
5. How to Validate WordPress Schema
- 1Go to your WordPress page or post (published, not preview)
- 2Copy the full URL
- 3Paste it at schemavalidator.org to see all structured data and errors
- 4Cross-check with Google's Rich Results Test for rich-result eligibility
- 5Fix any errors in your plugin settings or custom code
- 6Request re-indexing in Google Search Console
6. Frequently Asked Questions
Does Yoast SEO (free) add all the schema I need?▼
Yoast Free adds Organisation, WebSite, BreadcrumbList, WebPage, and Article schema automatically. It does not include FAQPage, HowTo, Recipe, Event, or JobPosting schema (these are Premium or need RankMath). For e-commerce, Yoast + WooCommerce adds Product schema.
Is RankMath better than Yoast for schema?▼
For pure schema coverage, RankMath's free version outperforms Yoast Free — it includes FAQPage, HowTo, Recipe, Course, and Event schema built-in. For large teams with established Yoast workflows, Yoast Premium may be preferable for the additional support and editor integrations.
Can I use Yoast and Schema Pro at the same time?▼
Yes — Schema Pro is designed to complement Yoast, not replace it. Yoast handles meta tags and basic schema; Schema Pro adds richer schema types. Disable any overlapping schema types in Schema Pro to prevent duplication.
Why does Google Search Console show schema errors after a WordPress update?▼
WordPress and plugin updates can change how schema is generated. A theme update that changes template files is a common cause. After any major update, re-validate your key page templates with SchemaValidator.org and check GSC Enhancements for spikes in errors.
How do I add schema to a specific page type (not all pages)?▼
In WordPress, use conditional tags in functions.php: is_singular('post') for blog posts, is_product() for WooCommerce products, is_page(ID) for specific pages. Code Snippets plugins make this easier if you prefer not to edit functions.php directly.
Does having schema affect WordPress page speed?▼
Minimal impact. Schema is a small JSON block in the page <head> — typically 1–5KB. The HTML over-the-wire size increase is negligible and there is no JavaScript execution overhead since JSON-LD is static text, not script execution.
My WooCommerce products have AggregateRating but no reviews show on Google — why?▼
Google must be able to verify that the reviews are real and visible on the page. Confirm: (1) reviews are displayed on the product page without JS rendering issues, (2) ratingValue and reviewCount match what's visible, and (3) the page is indexed and has been recrawled since you added the schema.
Can I preview how my WordPress schema will look in Google before deploying?▼
Yes — paste your JSON-LD into SchemaValidator.org to check for errors before publishing. For live URLs, use Google's Rich Results Test which shows a rendering preview and which rich results the page is eligible for.
Audit Your WordPress Schema Now
Paste your WordPress site URL and see all schema errors, warnings, and duplicates instantly.
Validate WordPress Schema →