Structured data that contains errors is worse than no structured data at all. Broken markup can trigger manual actions in Google Search Console, suppress rich results, or misrepresent your content. Testing catches these problems before they reach production.
Why Testing Matters
Search engines silently ignore invalid structured data. You will not get an error page or a 500 status code. Your rich results simply will not appear, and you may never know why.
Testing lets you:
- Confirm that your JSON-LD is syntactically valid JSON.
- Verify that you are using schema.org types and properties correctly.
- Check that Google can extract rich result data from your page.
- Catch regressions when templates change or CMS data shifts.
Google Rich Results Test
The Rich Results Test is Google’s official tool for checking structured data eligibility.
How to Use It
- Go to search.google.com/test/rich-results.
- Enter a URL or paste a code snippet.
- Click Test URL or Test Code.
- Review the results. Google shows detected rich result types, errors, and warnings.
What It Checks
- Whether your markup qualifies for specific Google rich results (FAQ, Recipe, Product, etc.).
- Required properties for each rich result type.
- Property value formats (dates, URLs, enums).
- Nested object structure.
Limitations
- It only validates against Google’s supported types, not the full schema.org vocabulary.
- Some types that schema.org defines are not eligible for Google rich results.
- It renders JavaScript, so it will process dynamically injected JSON-LD.
- Results may differ from what Google actually indexes. The test is a snapshot, not a guarantee.
Schema Markup Validator
The Schema Markup Validator is maintained by the schema.org community. It validates against the full schema.org specification.
When to Use It
Use this tool when you want to validate types or properties that Google does not support for rich results. For example, SoftwareApplication properties that Google ignores but other consumers (Bing, Apple, AI systems) may use.
How It Works
- Go to validator.schema.org.
- Paste a URL or a code snippet.
- The tool parses your markup and reports errors against the schema.org vocabulary.
It checks property names, expected types, and structural validity. It does not tell you whether Google will generate a rich result.
Browser DevTools
Your browser’s developer tools are the fastest way to inspect structured data on any page.
Finding JSON-LD in Page Source
- Open DevTools (F12 or Cmd+Shift+I).
- Go to the Elements panel.
- Press Cmd+F (or Ctrl+F) and search for
application/ld+json. - Expand the matching
<script>tags to see the raw JSON.
Quick Validation
Copy the JSON content from the script tag and paste it into any JSON validator (like jsonlint.com). This catches syntax errors: missing commas, unescaped quotes, trailing commas.
Checking Dynamically Injected JSON-LD
If your site injects JSON-LD via JavaScript, the Elements panel shows the rendered DOM. The View Source (Ctrl+U) shows only the initial HTML. Compare both to confirm your script is executing correctly.
Google Search Console
Google Search Console provides ongoing monitoring of structured data across your entire site.
Structured Data Reports
Navigate to Enhancements in the left sidebar. You will see a section for each structured data type Google has detected:
- Valid — Pages with correct structured data that are eligible for rich results.
- Valid with warnings — Pages that work but have optional improvements.
- Errors — Pages with problems that prevent rich results.
Common Report Issues
- Missing field — A required property is absent. For example,
Productwithoutname. - Invalid value — A property value does not match the expected type. A date formatted as
"March 7, 2026"instead of"2026-03-07". - Page not indexed — The structured data is valid, but the page itself is not in Google’s index.
Using Reports Effectively
Check these reports weekly. When Google detects a new error, it often affects a template, meaning many pages are impacted at once. Fix the template, then use the Validate Fix button to request re-crawling.
Automated Testing
Manual testing does not scale. For sites with hundreds or thousands of pages, you need automated validation.
Extracting JSON-LD with a Script
You can extract JSON-LD from any page using a simple script:
// Node.js example using cheerio
const cheerio = require("cheerio");
const html = await fetch("https://example.com/page").then(r => r.text());
const $ = cheerio.load(html);
const jsonLdBlocks = [];
$('script[type="application/ld+json"]').each((i, el) => {
try {
jsonLdBlocks.push(JSON.parse($(el).html()));
} catch (e) {
console.error("Invalid JSON-LD on block", i, e.message);
}
});
console.log(JSON.stringify(jsonLdBlocks, null, 2));
CI/CD Integration Ideas
- Run a build step that crawls your staging site and extracts all JSON-LD blocks.
- Validate each block against a JSON schema that mirrors your expected structure.
- Fail the build if required properties are missing or types are wrong.
- Compare the count of JSON-LD blocks per page against a baseline to catch regressions.
Checking for Required Properties
Define your own validation rules based on page type:
// Example validation rules
const rules = {
"Article": ["headline", "datePublished", "author"],
"Product": ["name", "offers", "brand"],
"BreadcrumbList": ["itemListElement"]
};
function validate(jsonLd) {
const type = jsonLd["@type"];
const required = rules[type] || [];
const missing = required.filter(prop => !(prop in jsonLd));
return { type, valid: missing.length === 0, missing };
}
Common Errors and How to Fix Them
Missing required fields. Google requires specific properties for each rich result type. Check the Google structured data documentation for the required fields for your type.
Wrong property types. A price should be a number, not a string like "$49.99". An availability value should be a schema.org URL like "https://schema.org/InStock", not the string "in stock".
Invalid URLs. All URL values must be fully qualified. Use "https://example.com/page", not "/page" or "page".
Invalid dates. Use ISO 8601 format: "2026-03-07" or "2026-03-07T10:00:00-05:00". Not "March 7, 2026" or "07/03/2026".
Trailing commas. JSON does not allow trailing commas. This is invalid: { "name": "Test", }. Remove the comma after the last property.
HTML in property values. Strip HTML tags from values. "description": "<p>A great product</p>" should be "description": "A great product".
Testing Checklist
Use this checklist before deploying any page with structured data:
- JSON-LD is syntactically valid (no parse errors).
- Every JSON-LD block has
@contextand@type. - All required properties for your target rich result are present.
- Dates are in ISO 8601 format.
- URLs are absolute and resolve correctly.
- No HTML tags in string values.
- Nested objects have their own
@type. - Google Rich Results Test shows no errors.
- Schema Markup Validator shows no errors.
- Structured data is present in both source and rendered DOM.
- Google Search Console shows no new errors after deployment.