
By Muhammad Ilyas | SEOGlint
You have added JSON-LD structured data to your website. The code looks correct, your page loads normally, and everything appears ready.
But when you run a schema validation test, unexpected errors appear.
Sometimes the problem is a missing comma. Sometimes your JSON is perfectly valid, but the schema type or its properties need attention.
The important distinction is that valid JSON, meaningful Schema.org markup, and eligibility for Google rich results are three different things.
In this tutorial, we'll explore practical JSON-LD debugging techniques using examples from an original SEOGlint research project involving 12 distinct test cases.
1. Understand the Three Layers of Structured Data Validation
Before fixing an error, identify which validation layer is reporting it.
Layer 1: JSON syntax
JSON has strict formatting rules.
Property names must use double quotes, properties must be separated by commas, and trailing commas are not allowed.
A JSON parser can identify these problems before schema-specific validation begins.
Layer 2: Schema.org vocabulary and properties
Even when JSON syntax is correct, your structured data may contain an incorrect type name or incomplete information.
For example, an Organization object might be missing its name, or a BreadcrumbList might have no breadcrumb items.
The interpretation and severity of these issues depend on the validator and the intended use.
Layer 3: Google search feature eligibility
Passing JSON syntax and Schema.org checks does not automatically make a page eligible for a Google rich result.
Google has additional requirements for supported search features, and eligible markup does not guarantee that a rich result will appear.
This is why developers should avoid relying on a single validation result.
2. Example One: A Trailing Comma Breaks JSON-LD
Consider this Organization markup:
{
"@context": "https://schema.org",
"@type": "Organization",
"name": "Example Co",
"url": "https://www.example.com",
}
The final comma after the URL makes this invalid JSON.
In SEOGlint's documented test, the validator returned:
Invalid JSON: Expected double-quoted property name in JSON at position 125 (line 6 column 1)
The fix
Remove the trailing comma:
{
"@context": "https://schema.org",
"@type": "Organization",
"name": "Example Co",
"url": "https://www.example.com"
}
Developer takeaway: When a parser reports a problem near a closing brace, inspect the preceding property as well. The actual mistake may be on the previous line.
3. Example Two: Missing Schema Context
JSON-LD uses @context to identify how terms should be interpreted.
Consider this example:
{
"@type": "Organization",
"name": "Example Co",
"url": "https://www.example.com"
}
The JSON syntax is valid, but the Schema.org context is missing.
In our SEOGlint test, the checker reported:
Error: Missing "@context" (use https://schema.org)
It also suggested adding a logo, but that was reported separately as a warning.
The fix
Add the Schema.org context:
{
"@context": "https://schema.org",
"@type": "Organization",
"name": "Example Co",
"url": "https://www.example.com"
}
The important lesson is that an error and a recommendation should not automatically receive the same priority.
A validator's warning does not necessarily mean that a property is universally required.
4. Example Three: Missing Product and Offer Information
Product structured data can contain nested objects.
This creates another opportunity for mistakes: the parent object may be incomplete, or a nested Offer may be missing important information.
Consider:
{
"@context": "https://schema.org",
"@type": "Product",
"description": "A test product",
"offers": {
"@type": "Offer",
"price": "29.99"
}
}
SEOGlint's documented test reported:
- Product missing
name— error - Product could include
image— warning - Offer missing
priceCurrency— error
Notice that the checker distinguished missing fields from suggested improvements.
Suggested corrected example
{
"@context": "https://schema.org",
"@type": "Product",
"name": "Example Product",
"description": "An illustrative test product",
"image": "https://www.example.com/product.jpg",
"offers": {
"@type": "Offer",
"price": "29.99",
"priceCurrency": "USD"
}
}
This is an illustrative correction, not a separately verified test result.
On a production website, replace the example values with accurate product details. The markup should describe the actual product shown on the page.
5. The Most Interesting Finding: Zero Errors Can Be Misleading
One of the most useful observations in our research involved a misspelled schema type.
The submitted code was:
{
"@context": "https://schema.org",
"@type": "Artical",
"headline": "Example headline"
}
The intended type was Article, but the code contained Artical.
The JSON syntax was valid.
SEOGlint displayed zero errors and one warning, explaining that the type was outside its checker rule list and only syntax had been checked.
This reveals an important limitation of rule-based validation.
Zero reported errors does not always mean your structured data has been completely validated.
If a checker does not recognize a type, it may be unable to perform its usual type-specific checks.
The intended type should be written as:
{
"@context": "https://schema.org",
"@type": "Article",
"headline": "Example headline"
}
Always verify type names against the Schema.org vocabulary.
6. A Practical JSON-LD Debugging Workflow
When structured data fails validation, use this sequence:
Step 1: Check JSON syntax
Fix trailing commas, missing separators, incorrect quotation marks, and unquoted property names.
Step 2: Verify the schema type
Confirm that @type contains the intended Schema.org type with correct spelling.
Step 3: Review nested properties
Inspect objects such as offers, acceptedAnswer, and itemListElement rather than checking only top-level fields.
Step 4: Compare markup with the actual page
Structured data should accurately describe real content, products, organizations, or events.
Step 5: Run independent validation checks
Use a general Schema.org validator and, where applicable, Google's Rich Results Test.
Step 6: Retest after changes
A suggested fix is not the same as a verified result. Save the corrected snippet and test it again.
7. Tools for Debugging Structured Data
These tools serve different purposes:
SEOGlint Schema Markup Validator
Useful for checking JSON-LD syntax and the schema-specific rules supported by its checker.
https://www.seoglint.com/schema-markup-validator.html
Schema.org Validator
Useful for checking structured data against the Schema.org vocabulary.
Google Rich Results Test
Useful for evaluating markup against supported Google rich-result requirements.
https://search.google.com/test/rich-results
No single test guarantees search visibility or rich-result appearance.
8. What We Learned From 12 Original Tests
Our research documented 12 distinct intentionally flawed examples and 13 screenshots from the SEOGlint validator.
Four examples produced JSON parsing errors.
Seven examples produced missing-context or missing-property messages under the checker's rules.
One example, the misspelled Artical type, produced a warning rather than an error.
These were manually selected debugging cases, not a statistical benchmark of validator accuracy.
We did not independently test the same inputs against Google or Schema.org as part of the documented experiment, and the proposed fixes require retesting.
The central lesson is straightforward:
Debug syntax first, verify schema meaning second, and check search-feature eligibility separately.
Final Thoughts
Structured data debugging becomes easier when developers stop treating every validation message as the same kind of problem.
A missing comma is not the same as a missing schema property.
A warning is not necessarily an error.
And passing one validator does not guarantee Google rich results.
Understanding these distinctions can help you diagnose problems more accurately and avoid unnecessary changes.
Explore the Original Research
For the complete 12-case study, including original SEOGlint screenshots, observed validator messages, and suggested fixes, read:
12 JSON-LD and Schema Markup Mistakes: Real Tests and Fixes — SEOGlint
Research and examples by Muhammad Ilyas, SEOGlint.
About the author
Muhammad Ilyas is the creator of SEOGlint, a platform offering free tools for SEO auditing and structured data checks.
Website: https://www.seoglint.com/
About the author
- SEOGlint is a free SEO, GEO and AEO audit tool. We write practical, no-fluff guides on technical SEO, content optimization, and getting your site cited by AI search engines like ChatGPT, Perplexity and Google AI Overviews.
Comments
Join the discussionNo comments yet. Be the first to comment.
