Key Takeaways
- Every schema change must be tested before publishing — invalid JSON-LD is invisible to AI models, and you will not know it is broken without explicit validation
- Use a three-tool workflow: Schema.org Validator (vocabulary check), Google Rich Results Test (Google-specific rules), and Chrome DevTools (live DOM verification)
- The most common errors are invalid JSON syntax, wrong property types, and relative URLs — all of which cause AI models to silently ignore your structured data
- AI crawlers often do not execute JavaScript — verify that your JSON-LD appears in the raw HTML source, not just the rendered DOM
- Set up automated testing in your CI/CD pipeline or run a monthly audit to catch regressions from CMS and plugin updates
Want an instant structured data audit? Scan your website for free — AImetrico checks your schema markup, JSON-LD validity, and AI crawler access in 60 seconds.
Table of Contents
Why Testing Structured Data Matters
Structured data either works or it does not. There is no partial credit. If your JSON-LD has a syntax error — a missing comma, an unclosed bracket, a trailing comma after the last property — the entire block is unparseable. AI models like ChatGPT, Gemini, and Perplexity will silently skip it. No error message, no warning, no notification. Your Article schema, FAQ schema, and Organization schema become invisible.
This is why testing is not optional. Every schema block you add, every property you change, every CMS update that touches your templates — all of these can introduce errors that break your structured data silently. The only way to know your markup is working is to test it explicitly.
The stakes are significant. Research shows that pages with valid, comprehensive structured data receive up to 3.4x more accurate AI citations than pages without it. FAQ Schema alone improves AI content interpretation from 16% to 54%. But these benefits only apply when the markup is syntactically correct and semantically valid. Broken markup provides zero benefit — it is the same as having no markup at all.
For a foundation on how structured data works for AI SEO, start with our JSON-LD basics guide.
Tool 1: Schema.org Validator
URL: https://validator.schema.org/
The Schema.org Validator is the most comprehensive testing tool for structured data. It checks your markup against the full Schema.org vocabulary — every type, every property, every valid value. This is your first line of defense.
How to use it:
- Go to https://validator.schema.org/
- Choose "Code Snippet" (to test raw JSON-LD) or "Fetch URL" (to test a live page)
- Paste your JSON-LD block or enter your page URL
- Click "Run Test"
What it checks:
- Valid
@typevalues (catches typos like"Artcile"instead of"Article") - Valid property names for each type (catches
"writer"instead of"author") - Correct value types (catches
"author": "John"when it should be an object) - Proper nesting of objects (catches flat structures that should be nested)
- Valid
@contextdeclaration
What it does NOT check:
- Google-specific implementation requirements (use the Rich Results Test for that)
- Whether the schema content matches the visible page content
- Whether AI crawlers can actually access and parse the page
- Performance or load-time impact of your JSON-LD blocks
Pro tip: Always test each JSON-LD block individually first, then test the full page URL with all blocks combined. Some errors only surface when multiple schema blocks interact — for example, conflicting @context declarations or duplicate @id values.
Tool 2: Google Rich Results Test
URL: https://search.google.com/test/rich-results
The Google Rich Results Test is stricter than the Schema.org Validator but narrower in scope. It only validates schema types that Google supports for rich results: Article, FAQPage, HowTo, Product, Organization, BreadcrumbList, and others. For types Google does not support (like SpeakableSpecification), it will show no results but will not flag errors.
How to use it:
- Go to https://search.google.com/test/rich-results
- Enter your page URL or paste your code
- Click "Test URL" or "Test Code"
- Review detected schema types and any errors or warnings
Why use it alongside the Schema.org Validator:
Google's test applies additional rules beyond the Schema.org spec. For example:
- Google requires
headlineon Article schema to be under 110 characters - Google requires
imageon Article schema (Schema.org does not) - Google has specific requirements for
datePublishedformat - Google checks for some content-schema consistency (the page must have visible content matching the schema)
Even though Google deprecated some rich results (like HowTo), the test still validates the underlying markup structure. This catches implementation errors that the Schema.org Validator might miss.
Reading the results:
- Valid items (green) — schema is correctly implemented for this type
- Valid items with warnings (yellow) — schema works but is missing recommended properties
- Errors (red) — schema has critical issues that prevent it from being parsed correctly
- No detected items — either the schema type is not supported by Google or the markup is so broken it cannot be parsed at all
Tool 3: Chrome DevTools JSON-LD Check
The Schema.org Validator and Rich Results Test check your markup in isolation. But schema can break between your code editor and the live page — template engines can mangle JSON, CMS plugins can inject conflicting schema, and JavaScript frameworks can fail to render the <script> tags. Chrome DevTools lets you verify what is actually in the live DOM.
How to check JSON-LD in DevTools:
- Open your page in Chrome
- Press
F12(orCmd+Option+Ion Mac) to open DevTools - Go to the Console tab
- Paste and run this script:
// List all JSON-LD blocks on the page
const scripts = document.querySelectorAll('script[type="application/ld+json"]');
console.log(`Found ${scripts.length} JSON-LD block(s):\n`);
scripts.forEach((script, index) => {
try {
const data = JSON.parse(script.textContent);
console.log(`Block ${index + 1}: @type = ${data['@type']}`);
console.log(JSON.stringify(data, null, 2));
console.log('---');
} catch (e) {
console.error(`Block ${index + 1}: PARSE ERROR - ${e.message}`);
console.log('Raw content:', script.textContent.substring(0, 200));
}
});
What this tells you:
- How many JSON-LD blocks exist on the live page (sometimes CMS plugins add blocks you did not create)
- Whether each block parses correctly (
JSON.parsewill fail on invalid JSON, just like AI models will) - The actual content of each block as the browser sees it (after template rendering, plugin injection, and JavaScript execution)
- Parse errors with the specific error message (missing comma, unexpected token, etc.)
Critical check for AI: After running the DevTools script, also check the raw HTML source (View Source, not Inspect Element). Press Ctrl+U (or Cmd+U on Mac) and search for application/ld+json. If the JSON-LD is present in View Source, AI crawlers can read it. If it only appears in the rendered DOM (visible in DevTools but not in View Source), JavaScript-dependent AI crawlers may miss it. Many AI crawlers — including some modes of PerplexityBot and OAI-SearchBot — do not execute JavaScript.
Step-by-Step Testing Workflow
Here is the complete testing workflow to follow every time you add or modify structured data:
Phase 1: Pre-publish validation
Step 1: Validate syntax with Schema.org Validator
Copy each JSON-LD block individually into the Schema.org Validator (Code Snippet mode). Fix all errors. Address warnings for recommended properties — especially image, author, and datePublished which AI models rely on heavily.
Step 2: Check Google requirements with Rich Results Test Paste your complete page code (all JSON-LD blocks together) into the Rich Results Test (Code mode). Verify each detected schema type shows as "Valid" or "Valid with warnings." Fix any errors before proceeding.
Step 3: Cross-check schema against visible content Manually verify that the schema content matches the visible page content:
- Does the
headlinein Article schema match the<h1>on the page? - Does the
authorin schema match the visible author byline? - Does the
datePublishedmatch the visible publication date? - Do the FAQ questions in schema match the visible FAQ section?
Mismatches between schema and visible content reduce AI trust in your markup.
Phase 2: Post-publish verification
Step 4: Test the live URL with Rich Results Test After publishing, enter the live page URL into the Rich Results Test. This catches issues that code-level testing misses — server-side template errors, CDN caching problems, plugin conflicts.
Step 5: Run the DevTools check Open the live page in Chrome, run the DevTools script from the previous section, and verify all blocks parse correctly in the live DOM.
Step 6: Check raw HTML source
Press Ctrl+U / Cmd+U and search for application/ld+json. Confirm all blocks are present in the source HTML, not just the rendered DOM. This is the AI crawler readability check.
Phase 3: AI-specific validation
Step 7: Test with AImetrico Run a free scan at AImetrico to check how AI crawlers specifically interpret your page — including schema, content structure, and crawler access.
Step 8: Ask AI about your content Query ChatGPT, Gemini, and Perplexity about the topic your page covers. Check whether they cite your page, and whether the cited information is accurate. If the citation is inaccurate, your schema may be misleading the AI — revisit the content-schema alignment in Step 3.
Common Errors and How to Fix Them
Here are the ten most frequent structured data errors, ranked by how often we see them in audits:
1. Invalid JSON syntax
The error: Missing commas, unclosed brackets, trailing commas after the last property, or unescaped quotes inside strings.
Example (broken):
{
"@type": "Article",
"headline": "My Article",
"author": "John Smith", <-- trailing comma if last property
}
Fix: Use a JSON validator (jsonlint.com) before pasting into the Schema.org Validator. Most code editors (VS Code, Sublime) highlight JSON syntax errors in real-time.
2. Wrong property value types
The error: Using a plain string where Schema.org expects a nested object.
Example (broken):
{ "author": "John Smith" }
Example (correct):
{
"author": {
"@type": "Person",
"name": "John Smith"
}
}
Fix: Check the Schema.org documentation for each property's expected type. Properties like author, publisher, image, and address typically expect objects, not strings.
3. Relative URLs instead of absolute URLs
The error: Using /blog/my-article instead of https://example.com/blog/my-article.
Fix: All URL properties (item, url, image, mainEntityOfPage, sameAs) must use full absolute URLs starting with https://.
4. Missing required properties
The error: Omitting properties that Google or AI models expect. Common omissions: headline on Article, name on Organization, position on BreadcrumbList items.
Fix: Reference our schema guides for each type — Article, Organization, FAQ — which list required and recommended properties.
5. Schema content does not match visible content
The error: The headline in schema says "Complete AI SEO Guide" but the <h1> on the page says "AI SEO: Everything You Need to Know." The datePublished says 2025 but the visible date says 2026.
Fix: Keep schema and visible content synchronized. When you update the page, update the schema. This is the most common error after CMS updates — the CMS changes the visible content but the schema template uses cached or hardcoded values.
6. Duplicate or conflicting schema blocks
The error: Multiple Article schema blocks on the same page with different headline values, or a CMS plugin injecting its own Organization schema that conflicts with your manually added one.
Fix: Use the DevTools check to see all JSON-LD blocks on the live page. Remove duplicates. If a plugin injects schema, either use the plugin's schema exclusively or disable the plugin's schema output and use your own.
7. Invalid @type values
The error: Typos ("Artcle" instead of "Article"), non-existent types ("BlogArticle" — the correct type is "BlogPosting"), or using deprecated types.
Fix: Always reference the official Schema.org type list at schema.org/docs/full.html.
8. Missing @context declaration
The error: The JSON-LD block does not include "@context": "https://schema.org". Without it, parsers do not know which vocabulary the types and properties belong to.
Fix: Every JSON-LD block must include "@context": "https://schema.org" as its first property.
Testing JavaScript-Rendered Pages
If your site uses a JavaScript framework (React, Next.js, Vue, Angular), your JSON-LD may be injected into the DOM by JavaScript rather than being present in the initial HTML source. This creates a critical problem for AI crawlers.
The issue: Many AI crawlers — including some modes of OAI-SearchBot (ChatGPT), PerplexityBot, and ClaudeBot — fetch your page's initial HTML without executing JavaScript. If your JSON-LD only exists after JavaScript runs, these crawlers see no structured data at all.
How to test:
-
View Source test — Press
Ctrl+U/Cmd+Uon your page. Search forapplication/ld+json. If you find your schema blocks here, they are in the initial HTML and AI crawlers can read them. -
curl test — Open a terminal and run:
curl -s https://yoursite.com/page | grep -c "application/ld+json"
If the count is 0, your JSON-LD is JavaScript-rendered only.
- Google Rich Results Test — This tool renders JavaScript, so it will show your schema even if it is JS-rendered. Compare its results with the View Source test above — if the Rich Results Test finds schema that View Source does not, you have a JS-rendering dependency.
Solutions:
- Server-side rendering (SSR): Render JSON-LD on the server so it appears in the initial HTML. Next.js, Nuxt.js, and similar frameworks support this natively.
- Static generation: Pre-render pages at build time with JSON-LD included in the HTML.
- Inline
<script>tags: Place JSON-LD blocks directly in your HTML template rather than injecting them via JavaScript components.
For a broader checklist of technical requirements for AI visibility, see our AI SEO Checklist for 2026.
Automated Testing
Manual testing works for individual pages, but it does not scale. If your site has hundreds or thousands of pages with structured data, you need automated testing to catch regressions.
Option 1: CI/CD pipeline validation
Add a structured data validation step to your deployment pipeline. Use a JSON Schema validator or a custom script that:
- Extracts all
<script type="application/ld+json">blocks from your built HTML files - Validates each block is parseable JSON
- Checks that required properties are present for each
@type - Fails the build if critical errors are found
// Example: Node.js validation script for CI/CD
const fs = require('fs');
const cheerio = require('cheerio');
function validatePage(htmlFile) {
const html = fs.readFileSync(htmlFile, 'utf-8');
const $ = cheerio.load(html);
const errors = [];
$('script[type="application/ld+json"]').each((i, el) => {
try {
const data = JSON.parse($(el).html());
if (!data['@context']) errors.push(`Block ${i+1}: missing @context`);
if (!data['@type']) errors.push(`Block ${i+1}: missing @type`);
} catch (e) {
errors.push(`Block ${i+1}: JSON parse error - ${e.message}`);
}
});
return errors;
}
Option 2: Scheduled crawl and validate
Use a tool like Screaming Frog, Sitebulb, or a custom crawler to periodically scan your entire site and extract structured data. Flag pages where:
- JSON-LD blocks have parse errors
- Expected schema types are missing (e.g., Article pages without Article schema)
- Required properties are absent
- Schema content has drifted from visible content
Option 3: Real-time monitoring
Set up alerts that trigger when structured data changes unexpectedly. Google Search Console reports structured data issues under the "Enhancements" section — enable email notifications to catch problems early.
When to Re-Test
Structured data can break without any deliberate change on your part. Here are the events that should trigger a re-test:
| Event | Why Re-Test | Priority | |---|---|---| | Content edit | Schema may no longer match visible content | High | | CMS or plugin update | Yoast, Rank Math, and other plugins change schema output between versions | High | | Theme change | New themes may override or remove JSON-LD template blocks | Critical | | New page published | Verify schema is generated correctly from templates | High | | Server or CDN migration | Server-side rendering behavior may change | Critical | | Monthly audit | Catch silent regressions from incremental changes | Medium | | After AI visibility drops | Broken schema is a common cause of sudden AI citation loss | Critical |
Minimum cadence: Even if none of these events occur, run a full structured data audit at least once per month. Use the automated tools described above to make this manageable at scale.
A structured data failure often explains sudden drops in AI citations. If your AI visibility score drops unexpectedly, schema validation should be the first thing you check — before investigating content or crawler access issues.
Frequently Asked Questions
What is the best tool for testing structured data?
Use both the Schema.org Validator and Google Rich Results Test together. The Schema.org Validator checks against the full Schema.org vocabulary. The Google Rich Results Test applies stricter, Google-specific rules. For AI-specific validation, use Chrome DevTools to verify JSON-LD is parseable in the live DOM, then test with AImetrico for AI crawler readability.
How often should I re-test my structured data?
Re-test after every content change, CMS update, plugin update, or theme change. At minimum, run a full structured data audit monthly. CMS plugins can silently change schema output after updates. Set up automated testing to catch regressions before they affect your AI visibility.
What is the difference between Schema.org Validator and Google Rich Results Test?
The Schema.org Validator checks against the full Schema.org vocabulary — all types and properties. The Google Rich Results Test is stricter but narrower: it only validates types Google supports for rich results and applies Google-specific implementation requirements. Use both for comprehensive coverage.
Can AI models read structured data that has validation warnings?
Missing recommended properties (warnings) are usually still parseable — AI models read what is present and ignore what is missing. However, syntax errors, invalid types, and malformed JSON cause AI models to skip your structured data entirely. Treat errors as critical and warnings as important but not blocking. For guidance on which properties matter most, see our JSON-LD basics guide.
How do I test structured data on JavaScript-rendered pages?
Use the Google Rich Results Test with a live URL — it renders JavaScript before checking. Also use Chrome DevTools and the View Source check (Ctrl+U). If JSON-LD appears in DevTools but not in View Source, AI crawlers that do not execute JavaScript will miss it. The solution is server-side rendering or placing JSON-LD blocks directly in your HTML template.
What are the most common structured data errors?
The five most frequent errors are: (1) Invalid JSON syntax (missing commas, unclosed brackets). (2) Wrong property types (string where an object is expected). (3) Missing required properties. (4) Relative URLs instead of absolute URLs. (5) Schema content that does not match visible page content. All of these cause AI models to either skip your markup or produce inaccurate citations.
Get your structured data audited instantly
AImetrico validates your schema markup, checks AI crawler access, and scores your visibility across ChatGPT, Gemini, and Perplexity.
Trusted by 2,400+ websites -- No credit card required