Skip to content
FunnelGuard

Fix guide by FunnelsGuard

JSON-LD syntax errors: how to find and fix broken schema

SEO-223Medium impactOther toolBy FunnelGuardPublished Updated
On this page

What this issue is

JSON-LD is the format most sites use for schema.org structured data. It sits in a <script type="application/ld+json"> tag and must be strictly valid JSON. JSON is less forgiving than JavaScript. A parser reads the whole block or rejects it.

The most common syntax errors are: a trailing comma after the last item in an object or list, an unescaped double quote inside a text value (for example a product description containing "6-inch"), single quotes instead of double quotes, a missing comma between properties, unclosed brackets, and raw line breaks inside a string. Smart (curly) quotes pasted from a document also cause trouble.

Broken JSON-LD (two errors)json
{
  "@context": "https://schema.org",
  "@type": "Product",
  "name": "Garden shears",
  "description": "Sharp 8" blades for tidy hedges",
  "sku": "GS-100",
}
Fixed JSON-LDjson
{
  "@context": "https://schema.org",
  "@type": "Product",
  "name": "Garden shears",
  "description": "Sharp 8\" blades for tidy hedges",
  "sku": "GS-100"
}

Why it costs you leads or sales

When the block cannot be parsed, none of its data is used. Rich result features such as product price, ratings, FAQ and breadcrumbs can disappear from your listings. Search engines and AI tools also lose a clean, machine-readable description of your business, products and prices. Your page still ranks on its text, but it looks plainer than competitors and may get fewer clicks.

The problem is quiet. The page looks normal to visitors, nothing crashes, and you only notice when rich results vanish or Search Console reports an error. Edits to templates, plugins or product descriptions can introduce it at any time.

How one typo removes your schema
  1. Edit descriptionA quote or comma is added
  2. JSON-LD blockInvalid JSON is published
  3. Google parses pageBlock is unparsable
  4. Rich resultsPrice, rating, FAQ not shown

A single syntax error stops the parser, so everything after it is lost.

How to check if your site has it

Find broken JSON-LD
  1. Run the Rich Results Test

    Open Google's Rich Results Test, enter the page URL and look for messages such as 'Unparsable structured data' or 'Missing comma' with a line number.

  2. Check Search Console

    In Search Console open Enhancements and each report (Products, FAQ, Breadcrumbs). Errors such as 'Unparsable structured data' list affected URLs. Also check the Page indexing and Manual actions areas for related notices.

  3. Copy the block into a JSON validator

    View the page source, copy the contents of each ld+json script and paste it into a JSON validator such as jsonlint.com. It points to the exact character that breaks.

  4. Test with the Schema Markup Validator

    validator.schema.org checks syntax and schema.org types for any page, not just Google features.

  5. Test templates, not one page

    Check one page of each template (product, article, category, home). Errors usually come from a template or from text fields that contain quotes.

How to fix it

Where you fix it depends on who writes the JSON-LD: you by hand, a theme, a plugin or an app. Fix the source, not just the output.

Fix JSON-LD errors by platform
  1. Identify the source

    View page source and look at the ld+json script. Work out whether it comes from your SEO plugin, the theme or a custom snippet. Switching plugins off one at a time on a staging copy helps.

  2. Fix custom snippets

    If you hand-wrote the script in a code snippet plugin or the theme, correct the syntax. In PHP, build the data as an array and output it with wp_json_encode() so quotes are escaped for you.

  3. Update or report

    If a plugin or theme outputs bad JSON, update it. If the error remains, report it to the developer with the URL and the validator message.

Safe output with JSON.stringifyjavascript
const data = {
  "@context": "https://schema.org",
  "@type": "Product",
  "name": product.title,
  "description": product.description
};
const script = document.createElement('script');
script.type = 'application/ld+json';
script.text = JSON.stringify(data);
document.head.appendChild(script);
Common JSON-LD syntax errors and fixes
ErrorExampleFix
Trailing comma"sku": "A1",}Remove the last comma
Unescaped quote"name": "The "Pro" kit"Use \" inside the value
Single quotes{'name': 'Shop'}Use double quotes
Missing comma"a": 1 "b": 2Add a comma between properties
Curly quotes“name”Replace with straight quotes
Raw line breakLine break inside a stringUse \n or remove it
Before and after

Broken

  • Validator reports unparsable JSON
  • Search Console lists an error for the template
  • Rich results missing

Fixed

  • Block parses cleanly
  • Rich Results Test detects your items
  • Errors clear after Google recrawls

How to confirm it's fixed

Confirmation checklist
  • The JSON validator accepts every ld+json block on the page
  • The Rich Results Test shows no 'unparsable' message for the live URL
  • The Schema Markup Validator shows your types and properties
  • Pages with quotes or special characters in titles also pass
  • In Search Console, open the error and click Validate fix
  • Recheck the report after a few days, as Google needs to recrawl

How to prevent it happening again

Prevention habits
  • Generate JSON-LD with a JSON function or your SEO plugin instead of typing it by hand
  • Escape or encode every dynamic value
  • Test one page per template after theme, plugin or app updates
  • Paste content from a word processor as plain text to avoid curly quotes
  • Review the Search Console Enhancements reports on a regular schedule
  • Keep a staging site to test template changes first

How FunnelGuard handles this

FunnelGuard does not check JSON-LD syntax today. A schema syntax check is a possible future addition, but it is not something the product does now.

What FunnelGuard does do is run your real customer journeys, such as lead forms, checkouts and booking buttons, on a schedule. It checks each step, the tracking hits sent to ad and analytics platforms, and whether test leads reach your inbox and CRM. If a failure occurs, it re-checks from a second region and sends one alert with a screenshot and a likely cause. That covers broken conversion paths, not your schema markup.

To watch for JSON-LD errors, use Google Search Console's Enhancements reports and email notifications, run the Rich Results Test after template changes, and validate a sample page per template. You can also add a JSON parse check to your deployment pipeline. A free FunnelGuard read-only website audit is available if you want a broader look at your site.

Questions people ask

Why is my JSON-LD not valid?

The most common causes are a trailing comma after the last property, an unescaped double quote inside a text value, single quotes instead of double quotes, or a missing comma between properties. Paste the block into a JSON validator and it will point to the exact position of the error.

How do I escape quotes in JSON-LD?

Put a backslash before each double quote inside a string value, for example \"8\\\" blades\". Better still, generate the JSON with a function such as JSON.stringify, json_encode or Shopify's json filter, which escapes quotes automatically.

Does a trailing comma break JSON-LD?

Yes. Unlike JavaScript, JSON does not allow a comma after the last item in an object or array. The parser rejects the whole block, so none of its schema data is used.

How do I test JSON-LD for errors?

Use Google's Rich Results Test on the live URL, the Schema Markup Validator at validator.schema.org, and a JSON validator on the raw script contents. The JSON validator is best for syntax, and the other two check schema types and properties.

What does 'unparsable structured data' mean in Search Console?

It means Google found a structured data block it could not read as valid JSON. Open the affected URL, copy the ld+json script, and look for trailing commas, unescaped quotes or missing commas. After fixing, use Validate fix in Search Console.

Can one JSON-LD error hurt my SEO rankings?

It will not usually lower your rankings directly, but it removes the structured data Google would use for rich results and a clearer understanding of the page. That can reduce how attractive your listing looks and how well machines read it.

Does FunnelGuard check for JSON-LD syntax errors?

No. FunnelGuard does not check schema markup today. It monitors forms, checkouts, tracking hits and lead delivery. For JSON-LD, use Search Console, the Rich Results Test and a validator.

Does FunnelGuard catch this?

Other tool

Needs a different kind of tool.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.