Skip to main content
All rules

SEO-017

Structured data (JSON-LD) is not valid JSON

MediumDefault severity · SEO / Quality · SEO, quality and performance

Last reviewed

What it checks

Every <script type="application/ld+json"> block is parsed as JSON.

Why it matters

Search engines ignore structured data they cannot parse, so rich results (ratings, prices, FAQs) will not appear.

Recommended fix

Generate JSON-LD with JSON.stringify instead of string templates.

How to verify

Paste the page URL into Google’s Rich Results Test and confirm no parsing errors.

Example fix prompt

Generic prompt (your report adds the evidence)
Please fix this production issue in my app.

Issue SEO-017: Structured data (JSON-LD) is not valid JSON
Site: https://your-app.example

First confirm the issue in the code or live config. If it is not present, say so and change nothing.
Task: Fix the JSON-LD block(s) in the evidence so they are valid JSON: build the object in code and output it with JSON.stringify (escaping < as \u003c).

Constraints: make the smallest change that fixes this, keep the current design and behaviour, never paste secret values into code or chat, and tell me which files you changed.
Done when: Paste the page URL into Google’s Rich Results Test and confirm no parsing errors.

References