Structured Data Testing and Validation for AI
Structured data fails silently. A missing comma, a misspelled property or a price that stopped matching the page produces no error message on your site; visitors see nothing wrong, and the markup simply stops doing its job. Because nobody notices, broken schema can sit on a site for months. Testing is how you find out before the machines do. This guide sets out a four-level method, from "does it parse?" to "is it true?", the free tools that cover each level, how to automate the checks so a template change cannot quietly break them, and an honest note on what passing all four levels does and does not buy you in AI search.
Be clear about what you are testing for
Before the tools, a calibration. Structured data is a machine-readable description of what a page contains. It helps machines resolve entities and facts without guessing, and some Google search features depend on it. It is not an entry ticket to AI answers. Google's documentation on AI features and your website states that there are no additional requirements to appear in AI Overviews or AI Mode, and that you do not need to create new machine-readable files or special schema to appear there. Other AI engines do not publish whether or how they use schema at all. We take that question on directly in Does Schema Really Help AI Citation?
So the reason to test is not that valid schema wins citations. It is that wrong schema is worse than no schema. Markup that contradicts the page, points at the wrong entity or carries stale prices sends machines conflicting facts about you. If you publish structured data, it has to be correct, and the only way to know it is correct is to test it.
The four levels of validation
Most teams stop at the first level. Each level catches a different class of failure, and the later ones are where the costly errors live.
Level 1: Syntax. Does it parse?
JSON-LD is JSON. A trailing comma, an unescaped quotation mark inside a string, curly "smart quotes" pasted from a word processor, or a missing bracket makes the whole block unreadable. Parsers do not partially read a broken block; they discard it. This is the cheapest level to test and, in our experience, the most common way hand-edited markup breaks.
{
"@context": "https://schema.org",
"@type": "Organization",
"name": "Rivera Structural",
"url": "https://example.com/", <-- trailing comma: the whole block is invalid
}
Level 2: Vocabulary. Is it valid schema.org?
Valid JSON can still be meaningless. A type name with a typo ("LocalBuisness"), a property that does not exist on the type you used, or a value of the wrong kind (text where schema.org expects a URL or a nested object) parses fine and describes nothing. The Schema Markup Validator, the general-purpose validator maintained for schema.org, checks markup against the whole vocabulary rather than a single search engine's features. It is the right tool for any type, including types no search engine displays specially.
Level 3: Eligibility. Does it meet Google's feature requirements?
Google supports a specific set of rich result types, each with required and recommended properties defined in its search gallery documentation. Markup can be perfectly valid schema.org and still miss a property Google requires for a particular feature. Google's Rich Results Test checks a URL or code snippet against those requirements and shows which features the page is eligible for. Two cautions: it only evaluates types Google supports for rich results, so "no items detected" can simply mean you used a type outside that list; and eligibility is not a promise that Google will show the feature.
Level 4: Truth. Does it match the page and the world?
This is the level no automated validator checks for you, and it matters most. Google's structured data general guidelines require that markup represent the main content of the page and not describe content that is invisible to users. In practice, truth failures look like this:
- A Product block says
InStockat one price while the page shows a different price or "sold out." - An FAQPage block contains questions that were removed from the visible page months ago.
- Article
dateModifiedis the build date, not the date the content changed. - An Organization block lists an old phone number or address that your directory listings no longer use.
- Rating markup reflects reviews that are not shown on the page, or that were never genuine.
Every one of these passes levels 1 to 3. Every one tells a machine something false about you.
A validator can tell you the markup is well formed. Only you can tell whether it is honest. The errors that cost trust are almost always at the level no tool checks.— ClickRadius Institute analysis
Test the HTML the crawler actually receives
Many testing mistakes come from validating the wrong copy of the page. Three checks prevent them.
- Raw versus rendered. The Rich Results Test renders JavaScript, so it will happily validate JSON-LD injected by a tag manager. Crawlers that do not render, which includes most AI crawlers as far as anyone can observe, never see that markup. Check the raw source as well, as explained in JavaScript Rendering and AI Crawlers.
- Mobile versus desktop. If your templates differ by device, test the mobile version, because that is the version Google indexes. Markup present only on desktop is a common silent gap, covered in Mobile-First Indexing and AI Search Visibility.
- Templates, not pages. Most structured data is generated by templates. Test at least one URL from every template type (article, product, location, category, author), plus any page with unusual data, such as a product with no reviews or an article with two authors.
Cross-block checks validators miss
Pages increasingly carry several connected blocks or a single @graph, as described in Nesting Schema. Validators check each node, but they do not always tell you when the graph as a whole is incoherent. Check these by hand or by script:
- Dangling references. Every
@idyou reference should be defined somewhere a crawler can reach, ideally on the same page or a stable entity page. - Identifier consistency.
https://example.com/#organdhttps://example.com/#organizationare two different nodes. Pick one convention sitewide. - Duplicate entities with different values. A theme's Organization block and a plugin's Organization block on the same page, with different names or logos, give machines two answers to one question.
- URL agreement. The page's
urlandmainEntityOfPageshould match the canonical URL, as covered in Canonical Tags in the AI Era.
Automate it so templates cannot regress
Manual testing catches today's errors. Automated testing catches tomorrow's, which is when most breakage happens: a theme update, a plugin conflict or a developer edit that nobody connected to schema. A simple check in your deployment pipeline can fetch a sample URL from each template, extract every JSON-LD block from the raw HTML, and fail the build if any block does not parse or is missing properties you have decided are mandatory.
import json, re, sys, urllib.request
REQUIRED = {"Article": ["headline", "datePublished", "author"],
"Organization": ["name", "url"],
"Product": ["name", "offers"]}
def check(url):
html = urllib.request.urlopen(url).read().decode("utf-8")
blocks = re.findall(r'<script type="application/ld\+json">(.*?)</script>', html, re.S)
if not blocks:
sys.exit(f"{url}: no JSON-LD in raw HTML")
for raw in blocks:
data = json.loads(raw) # level 1: fails on bad syntax
for node in data.get("@graph", [data]):
for prop in REQUIRED.get(node.get("@type"), []):
if prop not in node:
sys.exit(f"{url}: {node['@type']} missing {prop}")
for u in sys.argv[1:]:
check(u)
This sketch only covers levels 1 and part of 2, which is exactly the point: it is cheap and catches the breakage that happens most. Extend it with level-4 assertions where you can, for example comparing the Product price in the JSON-LD with the price element on the page, or confirming that every FAQ question in the markup appears in the visible text.
Monitor after deployment
Testing before launch does not tell you what happens afterward. Google Search Console's rich result reports show valid items, items with warnings and invalid items for supported types, and a sudden drop in valid items after a release is usually the first sign of a template regression. URL Inspection shows the structured data Google detected on a specific page. For types Google does not report on, a scheduled crawl that re-runs your pipeline checks against production is the practical substitute.
A testing routine that fits a small team
- Before publishing any new template, run a representative URL through the Schema Markup Validator and, for Google-supported types, the Rich Results Test.
- View the raw source and confirm the markup is there without JavaScript.
- Read the markup next to the page and check every fact: names, prices, dates, questions, ratings.
- Add the template's sample URL to your automated check.
- Review Search Console rich result reports after every significant release.
- Once a quarter, re-read your Organization and author markup against your current directory listings and profiles, because those facts drift as the business changes.
When something does fail, Why My Schema Isn't Working walks through the most common causes. And if you are still choosing a format, the case for JSON-LD as the easiest format to test in isolation is set out in JSON-LD vs Microdata.
Frequently asked questions
What is the difference between the Rich Results Test and the Schema Markup Validator?
The Rich Results Test checks markup against Google's requirements for the rich result types Google supports and shows which features a page is eligible for. The Schema Markup Validator checks markup against the full schema.org vocabulary, regardless of whether any search engine uses that type. Use the validator for general correctness and the Rich Results Test for Google feature eligibility.
If my structured data passes validation, will AI engines cite my page?
No tool can promise that. Google states that no special structured data is required to appear in its AI features, and other AI engines do not publish how they use schema. Passing validation means your markup is readable and well formed, so it is not sending broken or conflicting signals. Whether a page is cited depends mainly on its content, its authority and how well it answers the question.
How often should structured data be tested?
Test every template before it launches, run automated checks on every deployment, and review Search Console reports after significant releases. Re-check facts such as prices, availability, contact details and dates whenever they change in the business, because markup that no longer matches reality is the most common failure, and no automated validator detects it.
ClickRadius tests structured data in the HTML crawlers receive, flags syntax errors, missing properties, conflicting duplicate blocks and markup that disagrees with the visible page as part of its six-category AI-citation score, and can generate corrected JSON-LD. Get your free AI Readiness Score, or see plans on the pricing page.