Guides

How to Add Schema Markup to WordPress (Step by Step)

Bilal Haider 5 min read

How to Add Schema Markup to WordPress (Step by Step)

Schema markup is extra code that tells search engines what your page is about: a business, an article, a product. Done correctly, it helps Google understand your content and can make some pages eligible for richer search results. Done carelessly, it adds errors and noise.

This guide explains what schema markup is, which types matter for a typical WordPress business site, and how to add and test it safely, either with a plugin or with a small piece of code.

What schema markup is

Google describes structured data as a standardized format for giving information about a page and classifying its content. Google supports JSON-LD, Microdata and RDFa, and recommends JSON-LD because it is the easiest to implement and maintain (Google Search Central). In WordPress, JSON-LD is also the easiest to add, because it is a separate block of code and does not touch your page layout.

One important point: structured data makes a page eligible for a feature. Google does not guarantee it will show one, even when the markup is valid.

Which schema types matter for a typical business site

TypeUse it forWhere
OrganizationYour business name, logo and linksHome page
LocalBusinessA business with a physical location or service areaHome or contact page
Article or BlogPostingBlog posts and guidesEach post
BreadcrumbListBreadcrumb navigationInner pages
ProductItems in an online storeWooCommerce product pages

All of these appear in Google’s structured data search gallery. Only mark up what is actually on the page, and only use types that fit your content.

A note on FAQ schema

You will still see old advice to add FAQ schema to every page. According to Google’s documentation changelog, FAQ rich results stopped appearing in Google Search in May 2026, and the FAQ rich result documentation was later removed (Google Search Central updates). A helpful FAQ section is still good for readers, but do not add FAQ schema expecting a rich result.

Step 1: Check what your site already outputs

Many WordPress themes and SEO plugins already output some schema, such as Article markup on posts. Before adding anything, test a page with Google’s Rich Results Test and see what it already detects. Adding a second copy of the same type creates duplicates and can cause conflicts.

Step 2: Decide what you need

For most small business sites, the basics are Organization or LocalBusiness on the home page and Article on posts. Online stores also need Product markup, which WooCommerce and most SEO plugins can output for you.

Know the required properties. For LocalBusiness, Google lists name and address as required, and recommends properties such as telephone, url, openingHoursSpecification and geo. For Article, there are no required properties, but Google recommends author, datePublished, dateModified, headline and image (LocalBusiness, Article).

Step 3: Generate the JSON-LD

You can write JSON-LD by hand or use a generator. My schema markup generator builds LocalBusiness, Organization and FAQ code from a simple form. Here is what a basic LocalBusiness block looks like. All details below are made-up example data, so replace every value with your real, visible business information:

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "LocalBusiness",
  "name": "Example Plumbing Co.",
  "url": "https://www.example.com/",
  "telephone": "+1-555-0100",
  "address": {
    "@type": "PostalAddress",
    "streetAddress": "123 Main Street",
    "addressLocality": "Springfield",
    "addressRegion": "IL",
    "postalCode": "62701",
    "addressCountry": "US"
  },
  "openingHoursSpecification": [{
    "@type": "OpeningHoursSpecification",
    "dayOfWeek": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"],
    "opens": "09:00",
    "closes": "17:00"
  }]
}
</script>

Step 4: Add it to WordPress

Option A: Use your SEO plugin

The simplest route is the schema or structured data settings of your SEO plugin, if it has them. Check its documentation for which types it supports and how to set your business details.

Option B: Add a small code snippet

If you want full control, output the JSON-LD only on the page that needs it. Put the code in a child theme or a code snippets plugin, not in the main theme’s files, because theme updates overwrite those. Take a backup first: a typo in PHP can break the site. Here is a pattern for the front page only:

add_action( 'wp_head', function () {
    if ( ! is_front_page() ) {
        return;
    }
    ?>
    <script type="application/ld+json">
    { ...your JSON-LD here... }
    </script>
    <?php
} );

Step 5: Test the result

  1. Open the Rich Results Test, enter the page URL and run the test.
  2. Fix any errors it reports, such as a missing required property.
  3. Check the page with the Schema Markup Validator for syntax problems.
  4. Later, watch Google Search Console for structured data reports and warnings.

Rules Google expects you to follow

  • The markup must match the visible content of the page. Do not mark up information readers cannot see.
  • Do not mark up irrelevant or misleading content.
  • Include all required properties for the type.
  • Do not block pages that carry structured data with robots.txt or a noindex tag.

These come from Google’s structured data policies (general guidelines). Breaking them can make a page ineligible for rich results.

Common mistakes

  • Adding the same schema twice, once by the theme or plugin and once by hand.
  • Copying example data (like the plumbing business above) without replacing it.
  • Marking up reviews or ratings that are not shown on the page.
  • Putting the code on every page when it describes only one.
  • Expecting rich results immediately, or at all.

Troubleshooting

  • The test shows no items: check the code is in the page source and not stripped by a caching or optimisation plugin. Clear the cache and test again.
  • Errors about missing fields: add the missing required properties, or remove that type if it does not fit your page.
  • Duplicate items: turn off schema output in either the theme or the plugin, so only one source remains.
  • Site broke after adding the snippet: restore the backup or remove the snippet through your hosting file manager.

Frequently asked questions

Does schema markup improve rankings?

Google presents structured data as a way to help it understand a page and show eligible rich results. It does not promise a ranking boost, so treat it as a clarity improvement, not a shortcut.

Do I need a plugin for schema?

No. A plugin is convenient, and a small snippet works too. What matters is accurate, valid markup that appears once.

Which format should I use?

JSON-LD. Google recommends it, and it is easy to keep separate from your page design.

Next steps

Make sure Google can crawl your pages by checking your WordPress robots.txt, and keep your site secure with the WordPress security checklist. If you would like help setting up structured data properly, see my services.

Written by Bilal Haider, WordPress designer and developer. Last updated: November 23, 2026.

Leave a Reply

Your email address will not be published. Required fields are marked *

Keep reading

Related articles

Start your project

Let's build a website that wins you clients

Tell me about your business and goals. Within 24 hours you get a clear plan, a fixed-price quote and honest advice, with no pressure and no obligation.