Worsoo
A magnifying glass and warning symbol beside JSON code.

Invalid JSON Structured Data: How to Find and Fix the Error

By Worsoo Digital Agency · Last updated November 29, 2026

To fix invalid JSON structured data, find the broken script on the published page, correct the first syntax error, and test the live URL again. If a WordPress theme or plugin writes that script, fix it there so the next product or post gets the correction too.

A product name shows how easy this error is to miss. In a test for this guide, Desk Lamp worked, but Desk Lamp, 12" Shade broke the same hand-built script. Here’s how to find the character that caused the error without changing the name shoppers see.

Key takeaways

  • A parsing error means a tool cannot read the code. A missing-field warning means it read the item and found a detail to check.
  • Inspect the line before the reported error. A missing comma there can make the next line look wrong.
  • If only a few pages fail, compare their titles, descriptions, and empty fields with a working page that uses the same layout.
  • Test the repair on two live pages with different content. Each should pass and keep its own correct details.

What does “invalid JSON structured data” mean?

Invalid JSON structured data means the code that labels information on a page breaks a rule of JSON. A parser is a tool that reads this code. It can stop at a missing comma, an extra quotation mark, or a bracket facing the wrong way, even when the page looks fine to a visitor.

JSON-LD is a common way to add structured data to a website. On a store page, it can tell a search engine which text is the product name, which number is the price, and which code identifies the model. Worsoo’s guide to schema markup explains how these details fit together.

Before editing the code, read the exact message. These three results call for different repairs.

What the test says What it means First check
Parsing error, such as a missing comma The tool cannot read part of the script. Inspect the punctuation at the error and just before it.
A detected item is missing a required field The tool read the item and found a detail needed for that search feature. Open the named item and review the field.
No supported items detected The tool found no item it can report for a supported search feature. Check which item you expected and whether the public page contains it.

If Google Search Console flagged the page, open its unparsable structured data report. Save one affected URL and the full error message. A note like “missing comma on the desk lamp page” gives you a better starting point than “schema is broken.”

How can one quotation mark break a product page?

JSON uses straight double quotes to mark the start and end of a text value. If a product name contains a double quote, the script needs to show that the character belongs to the name. Otherwise, the parser can mistake an inch mark in a measurement for the end of the title.

The broken product name

Imagine a US lighting store that sells a desk lamp with a 12-inch shade. Its template takes the product title from WordPress and places it between two quotation marks. The published code looks like this:

{
  "@context": "https://schema.org",
  "@type": "Product",
  "name": "Desk Lamp, 12" Shade"
}

A shopper reads the title as intended. The parser reaches the quote after 12 and treats it as the end of the name. It then encounters Shade where it expects a comma or closing brace. The comma after Lamp is fine because it sits inside the text.

The corrected product name
The title shows 12" Shade, while the JSON uses 12\" Shade.

{
  "@context": "https://schema.org",
  "@type": "Product",
  "name": "Desk Lamp, 12\" Shade"
}

The backslash tells the parser to read the next double quote as part of the text. Once decoded, the name is still Desk Lamp, 12" Shade. The product title in WordPress can stay exactly as the store wrote it.

We checked three names with Python’s JSON parser. The hand-built script worked with Desk Lamp and Reader’s Lamp. It failed with Desk Lamp, 12" Shade. A JSON encoder preserved all three names and produced readable code for each. This short example tests the quotation mark. A store would need the relevant product and offer details for its intended search feature.

How do you find a JSON-LD syntax error in six steps?

Work from the exact code your website delivers. Copy the failing script, check its first error, and make one change at a time. When the copy passes, trace the mistake back to the field or template that produced it. That last step keeps the same error from returning after the next edit.

  1. Open the affected URL while signed out. Use the published address from the report. A WordPress preview can contain changes that customers and testing tools cannot see yet.
  2. Find the script that describes the affected item. Open the page source and search for application/ld+json. If several scripts appear, look for a distinctive value such as the product name, article headline, or street address. If JavaScript adds the markup after the page loads, inspect the loaded page in your browser’s developer tools.
  3. Copy the JSON into a parser. Copy the contents of one script, from its opening { or [ through its matching closing character. Leave the HTML <script> tags out of a JSON-only parser. Keep an untouched copy of the original so you can see exactly what changed.
  4. Read the first error and the line before it. If the tool points to "author", check how the previous field ends. The author field might be correct. The parser may have reached it while still waiting for a comma.
  5. Repair one mistake and test again. Add the missing comma, correct the quote, or close the bracket. Then rerun the parser. A second error may become visible once the tool can read past the first one.
  6. Fix the source and publish the change. Identify the plugin, theme, custom field, or snippet that writes the broken value. Correct that source and test the public page again. Editing a copy in a testing tool leaves the website untouched.

If someone else maintains your site, record the failing URL, the field, and the smallest change that makes it pass. Worsoo’s SEO audit template gives you a place to keep the evidence. “The product template fails when a title contains an inch mark” gives a developer a test they can repeat.

Which JSON mistakes should you check first?

Start with the punctuation between fields and around text. Then check any field an editor can leave empty. A template may work for products with complete records but produce an extra comma when a SKU, description, or other optional value is blank.

Mistake Broken example Correct form
Missing comma between fields {"name":"Lamp" "sku":"L12"} {"name":"Lamp","sku":"L12"}
Extra comma after the final field {"name":"Lamp",} {"name":"Lamp"}
Curly quotes around text {“name”:“Lamp”} {"name":"Lamp"}
Single quotes around text {'name':'Lamp'} {"name":"Lamp"}
Optional field has no value {"name":"Lamp","sku":} {"name":"Lamp"} if no SKU is available
Wrong closing bracket {"keywords":["lamp","desk"}} {"keywords":["lamp","desk"]}

Check where the character appears. A curly apostrophe inside "Reader’s Lamp" is valid. Curly double quotes used to enclose the field itself, as in “name”, break the JSON. That distinction matters if a client has hundreds of product names containing apostrophes. Those names need no change.

Line breaks follow a similar rule. You can put each field on its own line to make the script easier to read. Inside a quoted description, a line break must be encoded, typically as \n. The JSON syntax standard defines how strings, commas, braces, and brackets work.

Why do only some WordPress pages have invalid JSON structured data?

A shared template can work on most pages and fail when it receives one unusual value. Pick a working page that uses the same layout as a failing page. Compare the fields that change between them, especially product dimensions, quoted titles, multiline descriptions, and optional details.

Suppose a furniture store has 40 product pages. Two start failing after an editor adds sizes to their titles. The affected names are 24" Shelf and 18" Wall Light. Because the other 38 pages use the same theme and plugin, those inch marks give the developer a specific lead. A test copy of either title can confirm it.

An empty field creates a different pattern. Imagine a template always adds a comma after the product name because it expects a SKU to follow. Products with a SKU pass. A product without one ends up with {"name":"Wall Light",}. The last comma causes the error. Giving the item a made-up SKU would introduce bad product data. The template should omit the empty field and its separator together.

For a custom WordPress template, a developer can build the record from its fields and pass it through the WordPress JSON encoding function. An encoder handles the quotes and separators for the values it receives. It also lets an editor write a product title naturally without having to know JSON rules.

How do you verify the fix on the live site?

Test the original failing URL after publishing the repair and clearing the relevant page cache. Then check a second page with a different product name or SKU. Both pages should produce readable JSON, and each should keep its own details. This catches a shared template that accidentally gives every product the same title.

Run the affected URL through Google’s Rich Results Test. If it finds a supported item, expand it and read the values. In the lamp example, the decoded name should contain the inch mark a shopper sees. A literal backslash showing in the decoded name is a reason to check whether the template encoded the value twice.
Two checked product records show Desk Lamp with SKU L12 and Wall Light with SKU W18.

Before closing the issue, confirm that:

  • The product title still looks right to a signed-out visitor.
  • The live URL serves the corrected script.
  • The second page shows its own name and SKU.
  • A page with a blank optional field also passes.
  • Any remaining missing-field warnings have been recorded separately.

If the live test passes while Search Console still shows the original error, compare the last crawl date with the date you published the fix. An older crawl can describe the earlier version. Add a quoted product title and a blank optional field to your technical SEO checklist so you can catch the same problem after future template changes.

Frequently asked questions

Can invalid JSON stop Google from indexing my page?

A parsing error means Google had trouble reading the affected structured data. The page can still be indexed and appear as a regular search result. Check the URL’s indexing status separately in Search Console. To repair the markup, focus on the script and the exact syntax error Google reports.

Why does a JSON parser highlight a line that looks correct?

The parser reports where it could no longer continue. If one field is missing its closing quote or comma, the next field can look like the source of the problem. Read backward from the highlighted character and check how the previous value ends before changing the highlighted field.

Should I paste JSON-LD into a WordPress Code block?

A WordPress Code block is useful when readers need to see an example, as they do in this guide. To publish working structured data for the page itself, use a schema plugin or a template that outputs a JSON-LD script. Inspect the published page to confirm what WordPress saved.

Do I need to remove inch marks and apostrophes from product titles?

Keep the title accurate for shoppers. An apostrophe can appear inside a double-quoted JSON value, and an inch mark can be encoded. If measurements keep breaking your markup, fix the template that writes the title. Then test it with a measurement, an apostrophe, and a plain product name.

Why did a missing-field warning appear after I fixed the JSON?

Once the tool can read an item, it can inspect the details inside it. The newly visible warning may concern a field it could not check before. Open the item and review the field named in the message. Add a value only when it applies and you have accurate information.

Fix the error where it starts

The lasting fix for invalid JSON structured data is to correct what produced the broken script. Find the first failing character, trace it to its field or template, and test two live pages with different values. That gives you evidence that the fix works the next time an editor changes a product name.

If an error keeps returning after a WordPress update or product edit, contact Worsoo for a structured data review. Send one failing URL, one working URL that uses the same layout, and the exact error message. Those details give our team a clear place to start.

Leave a Reply

Your email address will not be published. Required fields are marked *