WordPress Schema Markup for AI Search: The Exact JSON-LD Setup

Written by

in

AI SEARCH // FIELD GUIDE

~10 min read · Published

WordPress Schema Markup for AI Search: The Exact JSON-LD Setup

Structured data is the most over-promised and under-implemented thing in AI SEO. It will not make ChatGPT recommend you. It does not summon an AI Overview citation. Anyone selling schema as a citation button is lying to you.

Answer Engine Optimization AI Search Small Business
Free download

The AI Agent Setup Checklist

Twelve steps to a working agent, in the order I install them. Fourteen pages, no fluff.

Get the Free AI Agent Setup Checklist

Free · No account required

What it does is narrower and still valuable: it tells a machine, in a grammar it does not have to guess at, that these twelve facts belong to one business, and that this page, this author, and this organization are the same entities referenced elsewhere in the graph. When a model is trying to work out whether “J. Jernigan Plumbing” in Stafford and “Jernigan Plumbing LLC” in Fredericksburg are one company or two, that is the difference between being resolvable and being skipped.

This is the setup I run on WordPress sites, including the mistakes that cost me the most time.

What schema actually buys you

Three things, in order of value:

Entity resolution inside Google. Google merges records from your site, your Business Profile, your social profiles, and third-party mentions. Structured data is how you nominate the canonical version of your own facts. When two nodes disagree, Google trusts neither cleanly, and the entity that lands in the knowledge layer is whichever third party shouted loudest.

Clean extraction for parsers. Address, hours, price range, service list, and author identity in a machine-readable block means a retrieval pipeline does not have to infer them from prose.

Consistency under pressure. A schema graph is a written specification of your facts. If your GBP says one thing and your site says another, the mismatch surfaces during implementation rather than in a confused AI answer six months later.

What it does not buy you: authority, corroboration, or a recommendation. Those come from being written about by other people and publishing things worth citing.

The graph model, in one paragraph

JSON-LD is not a pile of tags. It is a graph of nodes, each with an @id, referencing each other. A WebPage has a publisher that points at an Organization. The Organization has a founder pointing at a Person. The Person has a sameAs list. When every page emits the same @id for the same entity, the graph composes into one coherent picture of your business. When each template invents its own IDs, you have published a dozen half-finished entities that contradict each other, which is worse than publishing none.

That single insight prevents most schema disasters.

The WordPress problem: two entities for one business

If you run Yoast, Rank Math, or AIOSEO, the plugin already emits an identity graph on every page. Most “schema plugins” and hand-written blocks then add a second, competing node on the about page with a different @id, a different name, and a different sameAs set.

The result, which I have shipped myself: your site tells Google your business is called “James” in one node and “James Jernigan” in another, with two different Facebook URLs and two different YouTube URLs, one of which is a dead channel path. Google cannot resolve it, so it falls back to string matching and picks whichever page mentions the name most often. That is why a person’s name can rank for a category archive instead of their about page.

The fix is not to remove the plugin. It is to rewrite its identity node in place, keeping the @id it already generated so nothing else in the graph breaks.

The exact setup: an mu-plugin that owns the identity

Put this in wp-content/mu-plugins/identity.php. mu-plugins load automatically and cannot be deactivated by a client, which is what you want for an identity contract.

<?php
/**
 * Canonical identity facts for the site.
 * Every page that references this entity gets these values.
 */
function site_identity_facts() {
    return array(
        'name'        => 'Example Business',
        'jobTitle'    => 'Owner',                       // Person only
        'description' => 'Example Business provides commercial HVAC service to property managers in Stafford, Virginia.',
        'url'         => 'https://example.com/about/',
        'image'       => 'https://example.com/wp-content/uploads/owner.jpg',
        'sameAs'      => array(
            'https://www.linkedin.com/company/example-business/',
            'https://www.google.com/maps/place/?q=place_id:YOUR_PLACE_ID',
            'https://www.facebook.com/examplebusiness',
            'https://www.youtube.com/@examplebusiness',
        ),
        'knowsAbout'  => array(
            'Commercial HVAC', 'HVAC Maintenance', 'Roof-Top Units',
        ),
    );
}

/**
 * Rewrite Yoast's identity node in place. Keeping its @id means no other
 * node in the graph loses the reference it was built against.
 */
add_filter( 'wpseo_schema_graph', function ( $graph ) {
    if ( ! is_array( $graph ) ) {
        return $graph;
    }

    $facts    = site_identity_facts();
    $identity = null;

    // Resolve the identity the same way Yoast does: WebSite.publisher.
    foreach ( $graph as $node ) {
        if ( is_array( $node ) && isset( $node['@type'], $node['publisher']['@id'] )
            && in_array( 'WebSite', (array) $node['@type'], true ) ) {
            $identity = (string) $node['publisher']['@id'];
            break;
        }
    }
    if ( ! $identity ) {
        return $graph;
    }

    foreach ( $graph as $i => $node ) {
        if ( ! is_array( $node ) || ! isset( $node['@id'] ) || (string) $node['@id'] !== $identity ) {
            continue;
        }
        $graph[ $i ]['name']        = $facts['name'];
        $graph[ $i ]['description'] = $facts['description'];
        $graph[ $i ]['url']         = $facts['url'];
        $graph[ $i ]['image']       = $facts['image'];
        $graph[ $i ]['sameAs']      = $facts['sameAs'];
        if ( isset( $node['@type'] ) && in_array( 'Person', (array) $node['@type'], true ) ) {
            $graph[ $i ]['jobTitle']   = $facts['jobTitle'];
            $graph[ $i ]['knowsAbout'] = $facts['knowsAbout'];
        }
    }
    return $graph;
}, 15 );

/**
 * Drop {"@id": "..."} references whose target node no longer exists.
 * Removing a schema piece without this leaves orphan pointers, which is a
 * worse signal than the duplicate you were trying to remove.
 */
add_filter( 'wpseo_schema_graph', function ( $graph ) {
    if ( ! is_array( $graph ) ) {
        return $graph;
    }
    $defined = array();
    foreach ( $graph as $node ) {
        if ( is_array( $node ) && isset( $node['@id'] ) ) {
            $defined[ (string) $node['@id'] ] = true;
        }
    }
    $prune = function ( $node ) use ( &$prune, $defined ) {
        if ( ! is_array( $node ) ) {
            return $node;
        }
        if ( isset( $node['@id'] ) && 1 === count( $node ) ) {
            return isset( $defined[ (string) $node['@id'] ] ) ? $node : null;
        }
        foreach ( $node as $key => $value ) {
            $out = $prune( $value );
            if ( null === $out ) {
                unset( $node[ $key ] );
            } else {
                $node[ $key ] = $out;
            }
        }
        return $node;
    };
    return array_values( array_filter( array_map( $prune, $graph ) ) );
}, 20 );

Two details worth understanding rather than copying blind. The priority of 15 on the first filter runs it before Yoast’s last-pass cleanup, so the rewritten node survives. And the prune pass exists because every time you remove a schema piece, other nodes that referenced it keep a pointer to nothing; dangling @id references are a real defect and they are invisible unless you go looking.

The types that matter, and what each is for

Schema typeWhere it goesWhat it fixes
Organization / LocalBusinessSitewide, one nodeName, address, phone, hours, service area
PersonAuthor and about pagesWho writes this, what they know, where else they exist
WebSiteHomepageSite identity and search action
WebPageEvery page, autoPage-to-site relationships
ServiceEach service pageWhat you sell, who for, area served
FAQPageGenuine Q&A sectionsQuestion-to-answer extraction
Article / BlogPostingPostsAuthor, date, topic
BreadcrumbListAll pagesStructure and hierarchy
Product + OfferOnly real productsPrice, availability

Two honest caveats. FAQPage no longer produces rich results for most sites since Google restricted that feature to authoritative government and health domains. It still gives parsers clean question-answer pairs, which is the point here, so keep it for extraction and stop expecting stars in the SERP. Review and AggregateRating markup for your own business is not eligible for rich results, and fabricating it is a manual-action risk.

Service and FAQ nodes, by hand

If your theme does not emit these, add them per page. This is a service page graph that references the sitewide identity by @id instead of redefining it:

{
  "@context": "https://schema.org",
  "@graph": [
    {
      "@type": "Service",
      "@id": "https://example.com/commercial-hvac/#service",
      "name": "Commercial HVAC Service",
      "serviceType": "Commercial HVAC maintenance and repair",
      "provider": { "@id": "https://example.com/#organization" },
      "areaServed": [
        { "@type": "City", "name": "Stafford" },
        { "@type": "City", "name": "Fredericksburg" }
      ],
      "offers": {
        "@type": "Offer",
        "priceCurrency": "USD",
        "priceSpecification": {
          "@type": "PriceSpecification",
          "minPrice": 250,
          "maxPrice": 1800,
          "priceCurrency": "USD"
        }
      }
    },
    {
      "@type": "FAQPage",
      "@id": "https://example.com/commercial-hvac/#faq",
      "mainEntity": [
        {
          "@type": "Question",
          "name": "How much does commercial HVAC maintenance cost?",
          "acceptedAnswer": {
            "@type": "Answer",
            "text": "Quarterly maintenance contracts for a single rooftop unit typically run $250 to $600 per visit, depending on unit count and access."
          }
        }
      ]
    }
  ]
}

The rule that makes this work: the @id values must match the ones your sitewide graph already uses. Copy the organization @id out of your homepage source. If you invent a new one here, you have created a second business.

If you inherited a site with three entities

The most common job is not a greenfield setup. It is a site that has been through two agencies, a page builder, and a schema plugin, and now emits contradictory identity on every template.

Work in this order, and do not skip the audit:

  1. Inventory the graph. Fetch the homepage, a post, a service page, and the about page. Extract every @id and every name, url, and sameAs value from each JSON-LD block. Put it in a spreadsheet.
  2. Pick the survivor. The node your plugin emits is usually the right one to keep, because everything else in the graph already references it. Note its @id exactly.
  3. Rewrite, do not add. Use the filter above to overwrite its fields. Delete hand-written blocks that define a second entity rather than referencing the first.
  4. Prune orphans. Every reference whose target you removed has to go, or the graph points at nothing.
  5. Reconcile with Google. The Business Profile is the source of truth Google already trusts. If your plan is to change the name format, change both, and expect a re-verification conversation with Google if the name itself moves.
  6. Re-crawl. Purge caches, resubmit the sitemap, and use URL inspection on the five most important pages. Structured data changes surface in Search Console Enhancements within days to weeks, not hours.

The whole job is usually a day of work and a week of waiting. The failure mode is doing it in the other order: publishing a beautiful new schema block on the about page while the old contradictory node keeps emitting on every other template.

Validation, in the order that catches real problems

  1. View source on three templates (home, a post, a service page) and count the JSON-LD blocks. More than two on a page usually means a plugin conflict.
  2. Extract every @id on a page and check that each {"@id": ...} reference has a matching definition. This is the check nobody runs and it is where most broken graphs are hiding.
  3. Rich Results Test for eligibility, understanding that “no rich results detected” is not the same as “invalid markup”.
  4. schema.org validator for syntax and type correctness.
  5. Search Console Enhancements after a few weeks, for items Google actually parsed.
  6. Diff the facts against your Google Business Profile, line by line. Name, phone, hours, service area, categories. Mismatch here undoes everything above.

The five failures that cost the most

  • Two Person or Organization nodes with different @id values. The single most damaging and most common. Merge into one, keep the ID the plugin generated.
  • A hand-written block that restates the business instead of referencing the sitewide node. Duplicates, contradictions, no resolution gain.
  • sameAs pointing at dead or unrelated profiles. A 404 Facebook page or a stranger’s YouTube channel dilutes the entity. Audit this list once a year.
  • Schema that contradicts the page. Marking up a $99 price while the copy says “starting at $149” teaches the model to trust neither.
  • Adding every type to every page. Twelve half-true nodes are worse than three accurate ones. Depth of truth beats breadth of markup.

Does any of this get you cited by ChatGPT?

Indirectly, and only in combination with the rest of the work. A clean graph makes you resolvable, which is the first of the four requirements in the AEO guide. It does not create corroboration, and it does not make a thin page citable.

What it does do is remove the most common silent failure: a business that is real, competent, and effectively anonymous to a machine because its own website described it three different ways.

Want the whole agent stack, step by step?

The free 12-step checklist is the exact order I install these systems in: model, tools, memory, guardrails, publishing. No account, no upsell wall.

Get the Free AI Agent Setup Checklist →

Next step

If you are on WordPress with Yoast, the highest-value hour you can spend is this: open your homepage source, list every @id, and find out whether you have one business or three.

The AEO guide covers what to do with a resolved entity once you have one, and the audit checklist is the fifteen-minute version if you want to know where you stand first.

[AI Search Optimization Checklist] | [Read the AEO guide]

Frequently asked questions

Do AI assistants read JSON-LD?

Retrieval systems parse structured data variably, and Google’s own AI features sit on a pipeline that does. It is not a guaranteed read by every assistant, which is why schema is a floor rather than a strategy.

Will schema get me rich results?

Only for eligible types and pages. FAQ rich results are restricted for most sites, and self-serving review markup is not eligible. Validate before you promise anyone stars.

Should I use a schema plugin instead of code?

A plugin is fine if it references one entity graph rather than emitting its own competing nodes. Check the source: two identity nodes is the failure mode.

Does schema help local SEO?

Yes, in combination with a complete Google Business Profile. BrightLocal’s citation data found the profile alone accounted for 28.5 percent of AI citations, so the two have to agree.

How do I know it is working?

You will not see a direct metric. Watch for cleaner entity behavior: the right page ranking for your name, the correct business description appearing in AI answers, and fewer mismatched facts across surfaces.

Can schema hurt me?

Mismatched or fabricated markup can, and removing schema pieces without pruning orphan references leaves a broken graph. Everything else is neutral at worst.

Get the free AI Agent Setup Checklist

Twelve steps, in install order, with the settings that actually matter and the ones that are noise. It is the same list I use when I stand a system up.

Get the Free AI Agent Setup Checklist

Free. No account. Fourteen pages.

Keep reading

AI SEO for Local Service Businesses: Own 'Near Me' Answers

For local business categories, usually. Whitespark measured AI Overviews in 68 percent of local business queri

Read it →

How to Rank in Google AI Overviews (Without Losing Clicks)

Not the clicks the summary absorbs. What you can do is get cited inside the summary, defend the query classes

Read it →

How to Get Recommended by ChatGPT (Step-by-Step)

Retrieval is where nearly all near-term wins sit, and retrieval reads pages you can influence.

Read it →

Search Console Query Classifier

Paste your query export and see what share of your clicks AI answers put at risk.

Open the tool →
James Jernigan

James Jernigan

autonomous marketing systems builder, independent researcher, and author of AI SEO and The Hands-Free Business. I ran an SEO service practice before building agent-run operations for small businesses, and I write down the parts that break. Founder of jamesjernigan.com, how2rank.com, profitpassively.com, and husslemarketing.com.

Comments

Leave a Reply

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