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.
{
"@context": "https://schema.org",
"@type": "Product",
"name": "Garden shears",
"description": "Sharp 8" blades for tidy hedges",
"sku": "GS-100",
}{
"@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.
- Edit descriptionA quote or comma is added
- JSON-LD blockInvalid JSON is published
- Google parses pageBlock is unparsable
- 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
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.
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.
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.
Test with the Schema Markup Validator
validator.schema.org checks syntax and schema.org types for any page, not just Google features.
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.
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.
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.
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.
Find the code
In Online Store > Themes > Edit code, search for 'application/ld+json' in your theme files and in any schema apps' output.
Use the json filter
In Liquid, wrap text values with the | json filter, for example "name": {{ product.title | json }}. It adds the quotes and escapes special characters. Remove trailing commas, for instance after the last item in a loop, using forloop.last.
Check apps
If an app injects the markup, disable it temporarily to confirm, then contact its support.
Open the Custom HTML tag
Find the tag that contains the ld+json script. Correct the syntax directly in the tag.
Escape variable values
If you insert variables such as the page title, quotes in the value can break the JSON. Use a Custom JavaScript variable that returns JSON.stringify(value) or build the object in JavaScript and inject it with JSON.stringify.
Preview and publish
Use Preview mode, check the rendered page with the Rich Results Test, then publish.
Find the embed
Check Page settings > Custom code (inside head tag) and any Embed elements for ld+json scripts.
Fix CMS-driven values
If you insert CMS fields into the script, a quote in a field breaks the JSON. Keep those fields free of double quotes or use a plain, fixed block for values that contain them.
Publish and retest
Publish the site and test the live URL.
Find the tracking code
Look in the funnel or website Settings > Tracking Code (header) and in Custom Code elements for ld+json scripts.
Correct the syntax
Remove trailing commas and escape double quotes with a backslash. Replace curly quotes with straight ones.
Save and retest
Save, publish and test the live page.
Find the markup
Check Settings > Custom Code and each page's SEO panel under Advanced SEO > Structured Data Markup.
Correct the JSON
Fix the syntax in the structured data box. Use straight double quotes and no trailing commas.
Publish and retest
Publish and run the Rich Results Test on the live URL.
Find the code
Check Settings > Advanced > Code Injection and page-level Advanced settings for ld+json scripts.
Correct the syntax
Remove trailing commas, escape inner double quotes and use straight quotes.
Save and retest
Save and test the live page.
Generate, do not hand-assemble
Build the data as an object in your language and serialise it with a JSON function (json_encode, JSON.stringify, to_json). This escapes quotes and avoids trailing commas.
Guard against script closing
Escape the sequence '</' inside values (for example as '<\/') so text cannot close the script tag early.
Add a test
Add a unit or build test that parses the generated JSON-LD for sample content with quotes and line breaks.
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);| Error | Example | Fix |
|---|---|---|
| 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": 2 | Add a comma between properties |
| Curly quotes | “name” | Replace with straight quotes |
| Raw line break | Line break inside a string | Use \n or remove it |
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
- 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
- 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.
Related issues
- SEO-208No structured data at allFix guide
- SEO-224Required properties missing (name, image) causing errors in Search ConsoleFix guide
- SEO-225Duplicate conflicting schema from theme and pluginFix guide
- SEO-218FAQPage markup invalid or content not visibleFix guide
- SEO-222Article schema missing author, datePublished, dateModifiedFix guide
- SEO-210Product schema missing on product pagesFix guide