How to Add Schema Markup to WordPress
Add schema markup to WordPress with Rank Math or Yoast SEO in a few steps, plus the caching trap that hides your changes from search.
Updated September 21, 2026
WordPress is a content management system that does not generate schema markup (structured data in JSON-LD format that helps search engines and AI answer engines understand your business, articles, and products) on its own. You need an SEO plugin, a code snippet plugin, or a manual theme edit to add it. This guide covers the two most common paths, Rank Math and Yoast SEO, plus the caching problem that hides your changes even after you publish them correctly.
Option 1: Rank Math
Rank Math's free version outputs basic schema (Article, Organization) automatically once you set your site identity under Rank Math's Titles & Meta settings. For a specific LocalBusiness or Product schema on one page:
1. Open the post or page in the WordPress editor. 2. Open the Rank Math panel in the sidebar. If it is hidden, click the three dot menu in the Gutenberg toolbar and choose Plugins. 3. Click the Schema tab, then Schema Generator. 4. Click Custom Schema and use the Schema Builder to add the properties you need: name, address, phone, hours, and so on. 5. Click Save for this Post to apply it to that page only.
The Custom Schema Generator, and reusable Schema Templates with Display Conditions (Rank Math SEO, then Schema Templates) that apply schema site wide or by post type, are Rank Math PRO features. The free plugin covers built in types like Article and basic Organization data, not the custom builder.
Option 2: Yoast SEO
Yoast handles schema through Site Representation rather than a builder. Go to Yoast SEO, Settings, Site Representation, choose whether the site represents an organization or a person, and fill in the name, logo, and social profiles. For local business fields, install the separate Yoast Local SEO add on, a paid extension that adds Business Info, Opening Hours, Maps, and Advanced tabs under its own settings screen. Yoast core does not include a free form custom schema builder; you get the types the plugin and its add ons are built to output.
Option 3: A header code plugin
If your plugin does not cover the schema type you need, paste your own JSON-LD directly into the site. Install WPCode, formerly Insert Headers and Footers, go to Code Snippets, then Header & Footer, and paste a script tag with type application/ld+json into the Header field. This works with any theme and any schema type, but Rank Math or Yoast will not know about it, so check for duplicate Organization or WebSite schema if more than one source is active.
What is not possible
Neither Rank Math free, Yoast core, nor a header snippet plugin validates your JSON-LD syntax before it goes live, and none of them removes duplicate schema added by a theme, a page builder, and a plugin at the same time. You have to check for duplicates yourself.
The caching trap
If your site runs a caching plugin such as WP Super Cache or W3 Total Cache, or your host caches pages, or you use a CDN like Cloudflare, editing your schema does not mean crawlers see the new version right away. A cached copy of the old page can keep serving the old JSON-LD until the cache expires or you clear it. After adding or editing schema, purge the plugin cache, then purge any host level or CDN cache separately.
How to verify
View the page source, not just the rendered page, and search for application/ld+json to confirm the new block is present and not duplicated. Run the page through a structured data testing tool to catch syntax errors. Then check what your site actually exposes to crawlers with the AI Crawler Checker, and confirm your structured data setup with the Local Business Schema Generator. If you have not run a full visibility check yet, get your score at /#score.
Related tools
- LocalBusiness Schema Generator
Build a paste-ready LocalBusiness JSON-LD block with the correct subtype.
- AI Crawler Checker
Check your live robots.txt against the crawlers that feed every major AI engine.
- llms.txt Generator
Turn your business summary and key pages into a valid llms.txt file.
Frequently asked questions
- Does WordPress add schema markup automatically?
- No. Core WordPress ships no structured data. Some themes output minimal schema, and SEO plugins like Rank Math and Yoast add basic Organization or Article schema once configured, but LocalBusiness, Product, and FAQ schema generally need a plugin's paid tier or a manual JSON-LD snippet.
- Do I need Rank Math PRO to add local business schema?
- The free version outputs basic schema automatically, but the Custom Schema Generator and reusable Schema Templates with display conditions are Rank Math PRO features. You can work around this with a manual JSON-LD snippet through a header code plugin instead.
- Why isn't my new schema showing up in testing tools?
- Caching is the most common cause. Page caching plugins, host level caching, and CDNs can keep serving an old cached version of the page after you save changes. Clear the plugin cache and any host or CDN cache, then reload the page in a private browser window before retesting.
- Can I run Rank Math and Yoast schema output at the same time?
- You should not. Running both active can produce duplicate Organization or WebSite schema on the same page, which confuses search engines rather than helping them. Pick one SEO plugin for schema output, deactivate the other, or disable overlapping schema types in settings.
Sources
Check your business
See whether ChatGPT and Perplexity already recommend you, free, with no card and no sales call.