Key takeaways

  • On WordPress, structured data often comes from several places at once. The SEO plugin, the theme, WooCommerce and other plugins can each add their own.
  • Take an inventory first. Search the page source for application/ld+json and note which plugin or template wrote each block.
  • Give each schema type one owner. Use the SEO plugin’s settings first and add custom code only for what it does not cover.
  • When you add code, hook it into wp_head from a child theme or a small site plugin, and fill it from what the page shows.
  • Valid markup makes a page eligible. Google says it does not guarantee your structured data will show up.

Most WordPress sites I check already output structured data, often more than the owner knows about. The problem is rarely a lack of schema. It is schema from three sources that disagree with each other. Getting structured data for WordPress right is mostly housekeeping: find out what is there, decide who owns each type, and add custom markup only where it is missing. It is a regular part of my WordPress SEO consulting work.

For the general method, mapping pages to types, testing and measuring, see my guide on schema markup implementation for SMEs. This article stays with the WordPress side: plugins, themes, hooks and templates.

I first published this article in 2025 and have rewritten it, removing statistics and a supposed Google guideline update I could not trace to any source.

Where structured data comes from on a WordPress site

Google’s introduction to structured data notes that on a CMS such as WordPress you may not edit HTML directly, and that you may be able to install a plugin that lets you specify structured data. That is how most sites start. Then more sources pile up.

A web page receiving code blocks from several sources at once, a plug, a theme window, a shopping cart and a calendar, all feeding into its head section
Figure 1. On WordPress, structured data can come from several plugins and the theme at the same time.

On a typical small business site I find markup from some of these:

  • The SEO plugin. Most add a set of connected types to every page: the website, the organisation, the page and often breadcrumbs.
  • The theme. Older and multi-purpose themes sometimes add their own microdata to headers, posts or reviews.
  • WooCommerce or another shop plugin. Product markup on product pages.
  • Feature plugins. Events, recipes, reviews, FAQs, job listings and local business plugins often include their own schema.
  • Page builder widgets. Some review, FAQ or rating widgets add markup when you drop them on a page.
  • Hand-added code. A snippet a past developer pasted into a header field or a code plugin years ago.

Each source is reasonable on its own. Together they can describe the same business twice with different names, or mark up reviews twice on one page.

Take an inventory before you add anything

Before I write any markup, I list what already exists on each main template: the home page, a service page, a blog post, the contact page and, for a shop, a product and a category page.

  1. Open the page, view the source and search for application/ld+json. Each match is one JSON-LD block.
  2. Search for itemscope and itemtype too, which find microdata, usually from the theme.
  3. Look at the comment or class near each block. Plugins often label their output.
  4. Run the page through Google’s Rich Results Test, which Google calls “an easy and useful tool for validating your structured data.”

I write the results down in a simple table like this one:

Template Types found Source
Home page WebSite, Organization SEO plugin
Contact page LocalBusiness twice SEO plugin and an old snippet
Blog post Article, plus microdata SEO plugin and the theme
Product page Product Shop plugin

Anything appearing twice goes on the fix list. I wrote a separate guide to finding WordPress structured data conflicts if your inventory turns up a lot of duplicates.

Free tool · SEO ROI Calculator

Planning markup for your service pages? Estimate what the keywords behind those pages are worth first.

Enter search volume, CPC and your current ranking to estimate traffic, revenue and value for a keyword. Free.

Calculate your SEO ROI →

Choose one owner for each schema type

The rule I apply on every site is one owner per type. If the SEO plugin outputs the organisation, nothing else does.

Three pairs of identical code blocks, with one block in each pair kept and the other crossed out
Figure 2. Give each schema type one owner and switch off the duplicates.

I make the decision in this order:

  1. Plugin settings first. Most SEO plugins let you set the organisation or person, the logo and the page type in their settings. Fill these in properly before writing code.
  2. Switch off duplicates. Turn off schema output in feature plugins and the theme where the SEO plugin already covers the type, if they offer a setting. If the theme hard-codes microdata, that is a job for a developer in a child theme.
  3. Extend rather than add. Some SEO plugins offer documented filters for adding to their output. A developer can use them to keep everything in one connected set.
  4. Add a separate block only for gaps. If a type you need is not covered at all, add it yourself, on the templates that need it.

Pick the type with care. Google’s general structured data guidelines say “Try to use the most specific applicable type and property names defined by schema.org for your markup.” A plumbing firm is better described as a Plumber, which schema.org describes as “A plumbing service” under LocalBusiness, than as a generic organisation.

Adding structured data for WordPress with a hook

When I add custom markup, I use the wp_head action, which WordPress documents as the hook that “Prints scripts or data in the head tag on the front end.” I put the code in a small site-specific plugin or a child theme, never in the parent theme, because a theme update replaces the parent theme’s files.

Here is a minimal example for a contact page. Every value is a placeholder:

// In a small site-specific plugin or a child theme's functions.php.
// All values below are placeholders. Replace them with your real, visible details.
add_action( 'wp_head', 'example_plumber_schema' );

function example_plumber_schema() {
    if ( ! is_page( 'contact' ) ) {
        return;
    }

    $data = array(
        '@context'     => 'https://schema.org',
        '@type'        => 'Plumber',
        'name'         => 'Example Plumbing Ltd',
        'url'          => home_url( '/' ),
        'telephone'    => '+44 0000 000000',
        'address'      => array(
            '@type'           => 'PostalAddress',
            'streetAddress'   => '1 Example Street',
            'addressLocality' => 'Exampletown',
            'postalCode'      => 'AB1 2CD',
            'addressCountry'  => 'GB',
        ),
        'openingHours' => 'Mo-Fr 08:00-17:00',
    );

    echo '<script type="application/ld+json">' . wp_json_encode( $data ) . '</script>' . "\n";
}

A few points about this code:

  • is_page( 'contact' ) limits the block to one page. Markup belongs on the pages it describes, not on every URL.
  • wp_json_encode “Encodes a variable into JSON, with some confidence checks.” It is safer than building the JSON as a string by hand.
  • Google says “In general, Google recommends using JSON-LD for structured data if your site’s setup allows it.” On WordPress it nearly always does.
  • Check first that the SEO plugin does not already output a LocalBusiness or Organization for the same business. If it does, this block would be the duplicate.

Free tool · Ping My URL

Added or cleaned up the structured data on your key templates? Let search engines know the pages changed.

Notify Google and other search engines about up to 5 new or updated URLs at once. Free, no sign-up.

Ping your URLs →

Fill the markup from the page, not by hand

The example above has values typed into the code. That works for one contact page, but it goes stale the day the phone number changes on the site and not in the code.

A page with visible fields such as an address card, a phone and a clock, each joined by a line to a matching slot in a code block
Figure 3. Fill the markup from what is visible on the page, not from typed-in copies.

Google’s guidelines are firm on this point: “Don’t mark up content that is not visible to readers of the page,” and “Your structured data must be a true representation of the page content.” On WordPress the reliable way to meet both is to fill the markup from the same place the page gets its content:

  • post titles, dates and authors from WordPress itself;
  • business details from one settings page or the SEO plugin’s settings, also used in the footer and contact page;
  • service details from custom fields that the template shows on the page;
  • prices and stock from the shop plugin, never typed in twice.

If a value only exists inside the schema and nowhere on the page, I treat it as a mistake waiting to happen.

This is also why I am careful with review and rating markup. If the rating is not on the page, or the reviews are not about the thing marked up, leave it out.

Testing and keeping it working

Structured data breaks quietly. A theme update, a new plugin or a page builder change can add a second block or drop a required property, and the page looks the same to visitors.

After any change, I test one URL per template in the Rich Results Test. Google also points to the “Rich result status reports” in Search Console for monitoring after release, and notes that “You must include all the required properties for an object to be eligible” for a rich result.

Two limits to remember. Google says “Google does not guarantee that your structured data will show up in search results,” so valid markup is eligibility, not a promise. And misleading markup can cost you: “A structured data manual action means that a page loses eligibility for appearance as a rich result.”

My routine for WordPress sites is short: test the main templates after every theme or plugin update, check the Search Console reports once a month, and repeat the inventory once a year.

Rank Check Reports

Want to see which SERP features appear for your keywords? Each check lists the features found on every results page.

A live Google check of your keywords on desktop and mobile · from $14.99 per check · no subscription · report within one working day

Order a rank check report →

FAQ

Do I need a schema plugin on WordPress?

Usually not a separate one. Most SEO plugins already output the basic types. Add a dedicated schema plugin only for a type your SEO plugin does not cover, and check it does not duplicate what is already there.

Can I add JSON-LD without a plugin?

Yes. A developer can hook a JSON-LD block into wp_head from a child theme or a small site plugin, as in the example above. Keep it out of the parent theme so updates do not remove it.

Why does my WordPress site show two Organization or LocalBusiness blocks?

Usually because the SEO plugin and another plugin, the theme or an old snippet each output one. Find each source in the page source, keep the one you control best and switch off the rest.

Will structured data improve my rankings?

Google does not promise it. Structured data helps Google understand the page and can make it eligible for rich results, but Google decides what to show.

Eugen Platon

Eugen Platon

Director of SEO & Web Analytics at onwardSEO
Eugen Platon is a highly experienced SEO expert with 16+ years of experience propelling organizations to the summit of digital popularity. Eugen, who holds a Master's Certification in SEO and is well-known as a digital marketing expert, has a track record of using analytical skills to maximize return on investment through smart SEO operations. His passion is not simply increasing visibility, but also creating meaningful interaction, leads, and conversions via organic search channels. Eugen's knowledge goes far beyond traditional limits, embracing a wide range of businesses where competition is severe and the stakes are great. He has shown remarkable talent in achieving top keyword ranks in the highly competitive industries of gambling, car insurance, and events, demonstrating his ability to traverse the complexities of SEO in markets where every click matters. In addition to his success in these areas, Eugen improved rankings and dominated organic search in competitive niches like "event hire" and "tool hire" industries in the UK market, confirming his status as an SEO expert. His strategic approach and innovative strategies have been successful in these many domains, demonstrating his versatility and adaptability. Eugen's path through the digital marketing landscape has been distinguished by an unwavering pursuit of excellence in some of the most competitive businesses, such as antivirus and internet protection, dating, travel, R&D credits, and stock images. His SEO expertise goes beyond merely obtaining top keyword rankings; it also includes building long-term growth and optimizing visibility in markets where being noticed is key. Eugen's extensive SEO knowledge and experience make him an ideal asset to any project, whether navigating the complexity of the event hiring sector, revolutionizing tool hire business methods, or managing campaigns in online gambling and car insurance. With Eugen in charge of your SEO strategy, expect to see dramatic growth and unprecedented digital success.
Eugen Platon
Check my Online CV page here: Eugen Platon SEO Expert - Online CV.