Skip to content
WordPress Guide

How to Add Schema Markup to WordPress, Step by Step

Most WordPress sites already output some schema. Here is how to check it, manage it in your SEO plugin, add a custom block when needed and test the result.

A desk with website wireframes, a phone and coloured pens
7 sections · 8 min read
In this article · 7 sections

Most WordPress sites already output some schema markup without the owner ever touching it. If you have Rank Math or Yoast SEO installed, open any page, view its source and search for “application/ld+json”: you will probably find a block describing your website, your organisation and the page itself. The question is rarely how to add schema markup to WordPress from nothing. It is whether what is already there is correct, and what, if anything, to add on top.

This post is the practical side: where the settings live, which types a typical business site uses, how to add a block the plugin does not cover, and how to check the result. It does not promise that any of this will change how you appear in search. Google decides whether to show any special result, and markup is only one input. It also sits on top of the everyday settings covered in our introduction to SEO for WordPress beginners, which are worth sorting first. For the rest of what keeps a site in good shape, the WordPress site owner’s handbook is the place to start.

A quick definition before the settings

Schema markup, also called structured data, is a set of labelled facts added to a page’s code, using the shared vocabulary from schema.org. Visitors do not see it. Search engines and other software read it to understand that a page is about a business with a certain name and address, or that it is an article with a particular author and publish date. The format almost every WordPress plugin uses is JSON-LD, a self-contained script block that sits separately from your visible content.

If you want the longer explanation of which types are worth having and what they can and cannot do, read our explainer on structured data for business sites. For the details of local business markup specifically, including how to match it with your Google Business Profile, see LocalBusiness schema for a small business. This post stays with the WordPress mechanics.

Check what your site outputs today

Before changing anything, find out what is already there.

  1. Open a normal page of your site, such as a service page, in a private browser window.
  2. Run the address through Google’s Rich Results Test, which you can find by searching for that name. It lists the structured data it detects and flags errors and warnings for the types Google supports.
  3. Run the same address through the Schema Markup Validator at validator.schema.org. It checks against the whole schema.org vocabulary, so it shows types that the Rich Results Test ignores.
  4. Note which plugin or theme seems to be producing each block. SEO plugins usually combine everything into one “@graph” block; a separate block often comes from a theme, a page builder or another plugin.

The most common problem this reveals is duplication: an SEO plugin outputs an Organization block, and a theme, a reviews plugin or a separate schema plugin outputs another one with slightly different details. Two descriptions of the same business that disagree are worse than one that is right. Decide which plugin owns the business description and turn off that output everywhere else.

Using your SEO plugin’s schema settings

For most small business sites, the SEO plugin is the right place to manage structured data. It already knows your site name, logo, page titles and dates, and it keeps everything in one connected block, so a separate structured data plugin is rarely needed. Our Rank Math setup walk-through covers that plugin from the start; here are only the schema parts.

The site-wide details

Both main plugins ask whether the site represents an organisation or a person, and for a name and logo. Rank Math asks during its setup wizard, and you can change the answers later in its settings; Yoast SEO calls this section site representation. Fill these in carefully: the business name as customers know it, without extra keywords, and a clear square or rectangular logo. These details feed the Organization part of the markup on every page.

The per-page type

Each post and page also gets a type. Typically a blog post is marked as an Article or BlogPosting and a page as a WebPage. You can usually change the default type for each content type in the plugin’s settings, and override it on a single page in the plugin’s panel in the editor, which both plugins label Schema. For most pages the default is fine. Change it only when a page genuinely is something else, such as a contact page or an about page, if your plugin offers those choices.

Local business details

For a business with premises or a fixed service area, LocalBusiness markup with your address, phone and opening hours is the type most worth getting right. Rank Math has a Local SEO module for this, and Yoast offers local features through a separate add-on. Whichever you use, the details must match your contact page and your Google Business Profile word for word.

How to add schema markup to WordPress by hand

Sometimes the plugin does not cover what you need: a specific LocalBusiness subtype it does not list, an Event on a page that is not built with an events plugin, or a Service description. You can add a JSON-LD block yourself.

  1. Build the block. Our free schema markup generator builds the JSON-LD from a short form, which saves typing curly brackets and quotation marks yourself and getting one of them wrong.
  2. Read it before using it. Every value must be true and must match what the page shows. Remove any field you are unsure of rather than guessing.
  3. Choose where it goes. If the markup belongs on one page only, use a code insertion plugin that can target a single page (check whether that option is in the free version of the one you pick), or your SEO plugin’s custom schema feature if your version has one. Avoid pasting it into a Custom HTML block in the content if your plugin can place it properly, since page builders and theme changes can strip or move it.
  4. Test the page again in both tools above. Check that your new block appears once, that there are no errors, and that it has not created a second Organization or LocalBusiness block alongside the plugin’s.

Do not add markup by editing your theme’s header file. A theme update replaces that file and your code disappears without warning.

FAQ, review and other tempting types

Many guides suggest adding FAQ markup to every page so your answers appear under your search result. Google has narrowed this: it has said FAQ rich results are shown only for a limited set of well-known, authoritative sites. FAQ markup is still valid and harmless on a page that really has questions and answers, but a typical business site should not expect anything visible from it. Our post on adding an FAQ section in WordPress covers the visible side, which is what matters to your readers.

Review and star-rating markup has its own rules. Google’s guidelines rule out review stars for reviews a business gathers about itself and marks up on its own site, so marking up your testimonials in the hope of getting stars in search is likely to be ignored at best. Product pages in an online shop are different, and WooCommerce plus an SEO plugin usually handles those.

Whatever the type, mark up only what a visitor can see on the page, keep it true, and describe each thing once.

When something goes wrong

  • Errors appear in Search Console. Search Console shows reports for the structured data types it finds. An error usually names the missing or invalid field, such as an address without a postcode. Fix it in the plugin setting or your custom block, then use the report’s validation option.
  • Your custom block disappeared. It was probably in a theme file, a widget that was removed, or a page builder section that was replaced. Move it into a code plugin or your SEO plugin.
  • Two plugins both claim to handle schema. Leave one in charge. Many plugins that do something else, such as recipes, events or reviews, have a setting to turn off their own markup.
  • You switched SEO plugins. The new one starts with its own defaults. Recheck the site-wide details and test a few pages, because migration tools do not always carry schema settings across.

If a change makes things worse, undo it the simple way: switch the per-page type back to the default, or deactivate the snippet you added, and test again.

Frequently asked questions

Do I need a separate schema plugin if I already use Rank Math or Yoast?

Usually not. Both already output connected structured data for your site, organisation and pages, and both let you adjust the type per page. A separate schema plugin makes sense only for a type your SEO plugin cannot produce, and then you should check that the two do not both describe your business.

Can wrong schema markup cause problems for my site?

Honest slips, such as a missing postcode, usually just show up as errors or warnings to fix. Markup that misleads, such as describing content the page does not show, goes against Google’s structured data guidelines and may earn a manual action, after which rich results stop appearing for the pages affected. The Manual actions report in Search Console shows if that has happened.

Where exactly should a custom JSON-LD block go on a WordPress site?

In the page’s head or body as a script block, placed by a plugin rather than a theme file. A code insertion plugin that can target a single page, or your SEO plugin’s custom schema option if it has one, keeps the block safe through theme updates and redesigns.

Should every page carry the same LocalBusiness markup?

An SEO plugin often repeats the same business description across the site as part of its connected markup, which is fine because the details are identical everywhere. What causes trouble is extra hand-made blocks on single pages with slightly different details, such as another phone number. Keep one source for the business facts.

Overlapping markup left by old plugins and themes is tedious rather than difficult to unpick, and it is easy to switch off the wrong source. Our WordPress support service can help you decide which plugin should own the markup and turn the rest off.

Next in this series: SEO for WordPress Category Pages and Tag Archives

Is Your Website Working Properly?

Get a free website health check from WebMaintor. We'll review your website's speed, security, forms, and technical health — and tell you exactly what needs attention.

No obligation. No automated reports. A real review by our team.