sfw/fix
Unparsable structured data medium

Unparsable Structured Data

Google found structured data on the page but couldn't parse it because of a syntax error, so none of it counts.

What you see

Enhancements > Unparsable structured data
Parsing error: Missing ',' or '}' in object declaration
Invalid JSON document

What’s actually happening

You added JSON-LD or microdata for rich results — review stars, FAQ, breadcrumbs, a Product block — and Search Console reports it under "Unparsable structured data" instead of the specific type. That wording is the tell: Google never got far enough to know what the markup was supposed to be, because the syntax broke before it could read the @type. The page still ranks and renders fine for humans; it just gets zero rich-result eligibility. Drop the page into the Rich Results Test and it names the exact line and character where parsing died.

Common causes

  • A missing comma between properties, or a missing closing } / ] in the JSON-LD object — the single most common cause.
  • A template injected an unescaped double-quote or newline into a value (a product description with a literal " mid-string breaks the JSON).
  • Curly/smart quotes (“ ”) instead of straight ASCII quotes, usually pasted from a CMS rich-text editor.
  • A stray HTML tag or PHP echo printed inside the <script type="application/ld+json"> block.
  • Two adjacent JSON-LD objects concatenated without wrapping them in an array, producing one invalid document.

How to fix it

  1. Run the Rich Results Test on the live URLPaste the page into Google's Rich Results Test (or the URL Inspection live test). It points at the exact line and column of the parse failure — far faster than eyeballing the markup. The Schema Markup Validator (schema.org) is a good second opinion.
  2. Validate the raw JSON in isolationCopy everything between the <script type="application/ld+json"> tags into JSONLint or `cat file | python3 -m json.tool`. A pure JSON parser ignores the SEO and just tells you the structural error — missing comma, unbalanced brace, bad token.
  3. Fix quoting and escaping in the templateReplace smart quotes with straight quotes. Any value that can contain user/CMS text must be JSON-escaped at render time (a literal " becomes \", newlines become \n). In most stacks, building the object as a real array/dict and JSON-encoding it once is safer than hand-concatenating strings.
  4. Wrap multiple blocks in an arrayIf a page emits several schema objects, either give each its own <script> tag or combine them into a single JSON array `[ {...}, {...} ]`. Two bare objects back-to-back in one script tag is invalid JSON and trips this error.
  5. Re-test, then Validate FixConfirm the Rich Results Test now parses and detects the right type, then hit Validate Fix on the Search Console issue. Google re-crawls the affected URLs; the report clears as it reprocesses, which can take days.

Stop it recurring

Generate structured data from data objects you JSON-encode in code rather than hand-writing JSON in templates, and add the Rich Results Test to your pre-publish checklist for any page type that uses schema.

Related errors