How to Fix Malformed JSON-LD Schema Markup

errorThe Problem

Your page has JSON-LD schema markup, but it contains syntax errors — missing commas, unescaped quotes, unclosed brackets, or invalid data types. Malformed JSON-LD is completely ignored by Google.

trending_upWhy It Matters for SEO

Schema markup with syntax errors is worse than no schema at all — because you think you have it while Google sees nothing. This means no rich results, no star ratings, and no price display in search listings, despite having the code on your page.

buildHow to Fix It

  1. 1

    Test your pages at Google's Rich Results Test.

  2. 2

    Check for common JSON errors: missing commas, unescaped quotes in product descriptions, trailing commas.

  3. 3

    Open your theme's JSON-LD template.

  4. 4

    Use the json filter in Liquid to properly escape values: {{ product.description | json }}

  5. 5

    Re-test after fixing.

foldersnippets/product-schema.liquid
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Product",
  "name": {{ product.title | json }},
  "description": {{ product.description | strip_html | truncate: 500 | json }},
  "image": {{ product.featured_image | image_url: width: 1024 | json }},
  "offers": {
    "@type": "Offer",
    "price": {{ product.selected_or_first_available_variant.price | money_without_currency | json }},
    "priceCurrency": {{ cart.currency.iso_code | json }},
    "availability": "https://schema.org/{% if product.available %}InStock{% else %}OutOfStock{% endif %}"
  }
}
</script>
menu_bookRead Google's official documentationopen_in_new

Related Fix Guides

Want to check if YOUR store has this issue?

Scan your site for free — get copy-paste fixes in 60 seconds.

searchScan Now — It's Free