JSON-LD that does not parse
A JSON-LD block has a syntax error, so search engines skip all of it and none of the facts inside count.
Why it matters #
JSON-LD must be valid JSON. One missing comma, an extra comma at the end of a list, a stray quote mark or a comment is enough to make a parser give up. Google skips a block it cannot read, so every fact in it is lost, and so are any rich results it would have given.
Broken blocks often come from hand edits, from templates that put text containing quote marks into the JSON without escaping it, or from two plugins writing into the same block.
How to fix it #
Find the block and the error with the Schema Markup Checker. Fix the JSON, or let one plugin write the block. If a template inserts text, make sure it escapes quote marks and line breaks.
Remove empty blocks, and test the page again after every change.
- Find the broken block and the line the parser names.
- Fix the JSON or the template that writes it.
- Test the page again.
What it looks like, and fixed #
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Article",
"headline": "The "best" trail shoes of the year",
"author": { "@type": "Person", "name": "Sam Jones" },
}
</script>
Unescaped quote marks inside the headline and a comma after the last item: the parser gives up on the whole block.
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Article",
"headline": "The \"best\" trail shoes of the year",
"author": { "@type": "Person", "name": "Sam Jones" }
}
</script>
The inner quote marks are escaped with a backslash and the trailing comma is gone.
Fix it with your AI assistant #
Paste this into ChatGPT, Claude, Gemini or your coding agent. Fill in the words in [square brackets] first. It checks before it changes anything, changes only this, and tells you how to prove it worked.
My website [your website address] runs on [your platform, e.g. Shopify]. A check says a JSON-LD block on [the page address] does not parse, so search engines skip all of it. First fetch the page (or ask me to paste every script type="application/ld+json" block), parse each block as strict JSON, and tell me in plain words the exact error and line, such as a stray comma or an unescaped quote mark. Then give me the corrected block, changing only what is needed to make it valid and keeping every fact as it was. If a template or plugin builds the block, tell me where the bad text comes from and how to make the template escape it, for example with a JSON encoder or the json filter. Rules: back up first, do not add or remove facts, and do not touch other scripts. Tell me exactly where the fix goes. Finally, tell me to re-check with the URSY.com Schema Markup Checker at ursy.com/schema-checker/.
We find the problems, and help you fix them
- Check Run a free tool or the full audit.
- Fix it with your AI Download your AI Fix Pack and drop it into ChatGPT, Claude or Gemini. A free account is enough.
- Re-check Come back, check again, and watch each fix turn green.
Fix it on your platform #
WordPress
If the block comes from a plugin, update it or switch off a second plugin writing schema. If it comes from a custom field or snippet, fix the JSON there.
Shopify
In Liquid templates, print text with the json filter, for example {{ product.title | json }}, so quote marks and line breaks are escaped.
A hand-made site
Build JSON-LD with a JSON encoder in your code, such as json_encode in PHP, rather than joining strings by hand.
Check it is fixed #
Run the URSY.com Schema Markup Checker (/schema-checker/) on the page. Every JSON-LD block should parse, with no syntax errors.
Official source #
Questions #
Does one error break the whole block?
Yes. A parser that meets invalid JSON cannot read any of that block, so every fact in it is lost.
Can I put comments in JSON-LD?
No. JSON has no comments. Put notes in your template code outside the block instead.
More problems in Structured data
- Structured data is missing required fields High priority
- Structured data without a schema.org type Medium priority
- The dates on the page are missing, impossible or disagree Medium priority
- The page has no structured data Medium priority
- The site does not say who is behind it Medium priority