Guide

How to Add Schema Markup to Your WordPress Website

WordPress is the most widely used content management system in the world, and adding schema markup to a WordPress site is more straightforward than many people assume. Several well-established plugins handle the most important schema types automatically, and for more specific or custom requirements, manual JSON-LD code can be added through a plugin or the theme directly.

The right approach depends on the complexity of your site and which schema types you need. For most small business websites, a well-configured SEO plugin will cover the most valuable schema types without any manual coding. For e-commerce sites or those with more specialised requirements, additional plugins or custom implementation may be necessary.

Using an SEO Plugin for Schema Markup

The most efficient way to add schema markup to a WordPress site is through an SEO plugin. Yoast SEO and Rank Math are the two most widely used options, and both automatically generate schema markup for common page types. Yoast generates Organisation or Person schema for your homepage, WebSite schema with a SiteSearch action, WebPage schema for standard pages, Article schema for blog posts, and BreadcrumbList schema for navigational breadcrumbs — all without manual configuration.

Rank Math provides similar automatic schema with additional options through its interface. It includes a schema generator that lets you select from a wide range of schema types — FAQ, HowTo, Product, Review, Event, Course, Recipe — and populate them through form fields in the block editor, without writing any code. For most small business WordPress sites, either of these plugins configured correctly will deliver the most impactful schema types without developer involvement.

Adding Schema Manually With a Code Block

For schema types not covered by your SEO plugin, or for custom implementations, you can add JSON-LD schema manually. The cleanest approach in WordPress is to use a plugin such as Schema & Structured Data for WP, which provides a block you can insert into any page containing raw JSON-LD. Alternatively, a code snippet plugin such as WPCode allows you to add JSON-LD either globally (in the site head) or conditionally on specific pages or post types, without editing theme files directly.

If you need to add schema to every page of a specific type — for example, adding LocalBusiness schema to your homepage or Service schema to all service pages — a snippet plugin that targets content by page template or post type is the most efficient approach. Write the JSON-LD block once, test it with the Rich Results Test tool, then deploy it to all matching pages through the snippet's targeting rules.

Schema for WooCommerce and Local Business Sites

WooCommerce sites have specific schema requirements for product pages. Each product page should include Product schema with the product name, description, SKU, image, price, availability, and ideally review data. The Yoast WooCommerce SEO plugin adds WooCommerce-specific schema automatically. Rank Math similarly handles WooCommerce schema with its plugin active. Both generate the structured data from WooCommerce product fields without additional manual input.

For local service businesses, LocalBusiness schema is one of the highest-priority implementations. It should appear on the homepage and include your business name, address, telephone number, opening hours, geographic service area, and a link to your Google Business profile. Yoast SEO generates a basic version of this from its site settings, and you can enhance it with additional properties using a snippet plugin for any fields the SEO plugin does not cover. Verify the final output in Google's Rich Results Test and monitor performance in Search Console to confirm Google has detected and validated it correctly.

FAQs

Common questions.

Do I need to know how to code to add schema to WordPress?
For the most common schema types, no — SEO plugins like Yoast and Rank Math handle them automatically through their settings panels. For more specific or custom schema, a plugin like WPCode allows you to paste JSON-LD code into a field without editing PHP or theme files. Some basic familiarity with JSON-LD format is helpful for custom implementations, but it is far less complex than PHP or JavaScript development.
Will adding schema slow down my WordPress site?
No. Schema markup is a lightweight addition — a small JSON-LD script in the page head. It adds negligible page weight and has no meaningful impact on load times. The SEO plugins that generate schema (Yoast, Rank Math) may have some performance impact from their broader feature sets, but schema specifically is not a performance concern.
How do I check that my schema is working correctly in WordPress?
Use Google's Rich Results Test by entering your page URL. It shows which schema types were detected and whether they are valid or contain errors. In Google Search Console, the Enhancements section shows impressions and any errors for schema types detected across your whole site. After making schema changes, use the URL Inspection tool in Search Console to request re-indexing so Google picks up the update promptly.
Related guides

More on web design & ux.

Want a hand putting this into practice?

Book a free, no-obligation consultation with a Norwich-based specialist.

Book a free consultation
Get started

Let's put your business in a better light.

Book a free, no-pressure consultation. We'll talk through your goals and tell you honestly what we'd do — whether you work with us or not.

  1. 01
    Tell us a bitFill in the form — two minutes, tops.
  2. 02
    We'll call you backWithin one working day, no pressure.
  3. 03
    Get a clear planHonest advice and a fixed quote.

Free · No obligation · We reply within one working day

Book a free consultation