WordPress

How to Add Schema Markup in WordPress (With Real Examples)

How to add schema markup in WordPress: which types to use, LocalBusiness and FAQ schema, plugin vs manual JSON-LD, and how to test it, with real code.

By wptaskify TeamUpdated Oct 15, 20269 min read
How to Add Schema Markup in WordPress (With Real Examples)

Quick answer

Schema markup is a block of structured data, usually JSON-LD, that tells search engines what a page is about: your business, a product, an article, a set of questions. In WordPress the easiest way to add it is an SEO plugin that generates it from your settings and content. For anything the plugin does not cover, you can add your own JSON-LD block to a page. Then test it with Google's Rich Results Test.

What is schema markup?

Search engines read your page as text. Schema markup adds a labelled summary on top: this is a plumber, this is its phone number, these are its opening hours, this page is a service, these are questions and answers. The labels come from schema.org, a shared vocabulary used by Google, Bing and other search engines.

The format Google recommends is JSON-LD: a small script block in the page's HTML that visitors never see. It does not change how the page looks.

What schema does for you: it makes the page eligible for rich results (stars, prices, breadcrumbs, business details) and helps search engines and AI assistants understand who you are and what you offer. What it does not do: it is not a ranking boost on its own, and Google decides whether to show a rich result at all.

Which schema types does a WordPress site need?

Most sites need only a handful of types. Pick the ones that match what is actually on each page:

Table of common schema types for WordPress: Organization or LocalBusiness, Article, Service, Product, FAQPage and BreadcrumbList, with where each goes
The six schema types that cover most WordPress sites.

Method 1: Let your SEO plugin generate it

Every major SEO plugin outputs schema automatically: the site-wide Organization and WebSite, Article on posts, BreadcrumbList on every page. Your job is to fill in the settings it builds them from.

The setting most sites miss is the business type. Left blank, you get a plain Organization. Set it, and the plugin outputs LocalBusiness (or a more exact subtype such as Plumber, Dentist or Restaurant) with your phone, address, hours and service area. On our test site, a plumbing company, this is the card in the wptaskify plugin's SEO settings:

WordPress SEO settings Local business card with Business type set to Plumber, phone and email fields
The real Local business settings on our test site. Business type is set to Plumber.

What the generated LocalBusiness schema looks like

From those fields, the plugin prints this JSON-LD on every page. It is the real output from our test site, shortened. Note the type is Plumber, not just Organization, and it carries the address, the towns served and the opening hours.

Whatever plugin you use, open your home page, view the source (Ctrl+U) and search for application/ld+json. If you only see Organization with a name and logo, the business details are not filled in.

Real JSON-LD output with @type Plumber, name, telephone, PostalAddress, areaServed towns and opening hours
Real LocalBusiness (Plumber) JSON-LD from our test site's home page, shortened.

Schema for service pages

A service page should say it is a service and who provides it. The Service type does that, and its publisher points back to your business by its @id, so search engines connect the two.

On our test site every service and area page carries Service plus FAQPage in the same JSON-LD block:

Real JSON-LD from a service page with a Service item and a FAQPage with two questions and answers
Real JSON-LD from one service page: Service, then FAQPage built from the page's own questions.

How to add FAQ schema in WordPress

FAQ schema must match questions and answers that visitors can see on the page. Marking up text that is hidden, or that is not on the page at all, breaks Google's rules. So build the FAQ section first, then add the schema from it:

  • With a block: SEO plugins such as Yoast and Rank Math include an FAQ block that writes the visible questions and the FAQPage schema together.
  • By hand: write the questions as normal headings and paragraphs, then add a JSON-LD block with the same wording (see Method 2).

Be honest about the payoff: since 2023 Google shows FAQ rich results mainly for well-known government and health sites. FAQ schema is still worth having because it labels the questions clearly for search engines and AI assistants, but do not expect the expandable questions to appear under your listing.

The visible FAQ section Questions we hear in Dublin on a plumbing service page
The visible FAQ on that same page. The FAQPage schema uses exactly these questions.

Method 2: Add custom JSON-LD by hand

When your plugin does not cover a type, such as an event, a course or a recipe on a non-recipe theme, add the JSON-LD yourself:

  1. Write the JSON-LD. Start from the examples on schema.org or Google Search Central for that type, and fill in your real details.
  2. In the block editor, add a Custom HTML block to the page and paste it inside <script type="application/ld+json"> ... </script>.
  3. Update the page and test it (see below).

For a block that should appear on every page, add it to the header with a code snippets plugin or your child theme's functions.php, through the wp_head hook. Do not add a second Organization block if your SEO plugin already prints one: two different versions of the same business confuse more than they help.

Method 3: Ask your AI to check and fix it

If your WordPress site is connected to Claude or ChatGPT through wptaskify, you can ask about your schema in plain English. validate_schema reads the JSON-LD on one page or across the site and reports blocks that do not parse or are missing @context or @type. get_post_schema shows what a page carries, and update_post_schema replaces only the JSON-LD block on a page and leaves the content alone.

Example conversation: the AI runs validate_schema across the site and reports that every JSON-LD block parses
An example conversation using the real validate_schema tool.

How to test your schema markup

  • Google's Rich Results Test (search.google.com/test/rich-results) shows which rich results a page is eligible for, and any errors that block them.
  • Schema Markup Validator (validator.schema.org) checks every type against the schema.org vocabulary, including types Google does not use for rich results.
  • Google Search Console lists schema problems across the whole site under Enhancements, once Google has crawled the pages.

Test one page of each template (home, a post, a service page, a product) rather than every page. They share the same output.

Common schema mistakes in WordPress

  • Two plugins printing schema. An SEO plugin plus a separate schema plugin often output two Organization or two Article blocks. Turn one off.
  • Schema that does not match the page. Review stars with no visible reviews, prices that differ from the page, FAQs that are not shown. Google can ignore it or take manual action.
  • Wrong business type. A plain Organization where LocalBusiness or a subtype fits better.
  • Broken JSON after an edit. One missing comma and the whole block is ignored. Validate after every manual change.
  • Missing business details. Name and logo only, no phone, address or hours.

Schema is one item on the list. For the rest, see our WordPress SEO checklist, and for AI search, what llms.txt is and how to add it.

Frequently asked questions

How do I add schema markup to WordPress?

Use an SEO plugin that generates it, and fill in its settings, especially the business type, address and hours. For types the plugin does not cover, add a JSON-LD script in a Custom HTML block or through the wp_head hook, then test with Google's Rich Results Test.

Do I need a schema plugin if I already use an SEO plugin?

Usually not. Yoast, Rank Math, All in One SEO and the wptaskify plugin all output schema. A second schema plugin is only worth it for types your SEO plugin cannot create, and then turn off the overlapping output.

Does schema markup improve rankings?

Not directly. It makes pages eligible for rich results and helps search engines and AI assistants understand the page, which can improve clicks. It does not move a page up on its own.

How do I add local business schema in WordPress?

Set the business type in your SEO plugin's local business settings and fill in the phone, address, opening hours and service area. The plugin then outputs LocalBusiness or a subtype such as Plumber or Dentist.

Is FAQ schema still worth adding?

Yes, as long as the questions are visible on the page. Google now shows FAQ rich results mainly for government and health sites, but the markup still labels your questions and answers clearly.

Check and fix the schema on every page with your AIBring your own Claude or ChatGPT. Nothing goes live without your approval.
Get started free

Your AI is ready to work.

Connect WPTaskify and turn conversations into real actions.

Start Free