Securealy
Check · SEO · low · passive

JSON-LD parses

Structured data blocks parse as JSON.

Severity
low
Tier
Passive: runs on any URL
Category
SEO
Fix
Summary below; full runbook in the Fix Kit, Module 02: Be found
Id
json-ld

What this means

Every <script type="application/ld+json"> block on your home page is valid JSON and declares @context and @type. Those blocks are how search engines and answer engines read your organisation, site and prices as data rather than guessing from the page. Failing means at least one block does not parse or is missing one of those two keys.

How we test it

We fetch your home page, following at most 3 redirects, and extract the contents of every <script type="application/ld+json"> element. We parse each as JSON and check that it, or each object inside it if it is an array, has @context and @type. All blocks parsing with both keys passes; any block that fails to parse or lacks either key fails, and we show which one. A page with no blocks at all has nothing to parse, so this check only fails on a block that is present and broken.

Why it matters

Broken JSON-LD is ignored silently. No crawler reports a parse error back to you, so one unescaped quote or trailing comma means the Organization, WebSite and offer data you wrote is simply not there, while the page looks fine to a human. The Fix Kit notes that these blocks are the ones answer engines quote from, and that a block mounted twice, once in the layout and once in the page, produces duplicate ids that confuse validators just as quietly.

The fix

Repair the block so it parses, by generating it from templates/jsonld-blocks.md (static site, pasted into <script type="application/ld+json"> in the <head>) or from lib/jsonld.ts with jsonLdString() (framework, rendered inline in the root layout) rather than hand-editing JSON, with "@context": "https://schema.org" and an @type on every object. Then paste https://YOUR_DOMAIN/ into https://validator.schema.org/ and expect zero errors. The full runbook is in the Fix Kit, Module 02.

Prompt for your AI

Paste this into the coding agent that built the app. It reproduces the finding and stops before changing anything; the fix steps are in the kit.

Do not change anything yet. This is a verification pass only.
Run: curl -s https://YOUR_DOMAIN/ | grep -c 'application/ld+json'
Then run this parse check and show me the full output:
curl -s https://YOUR_DOMAIN/ | node -e '
let h="";process.stdin.on("data",d=>h+=d).on("end",()=>{
 const re=/<script type="application\/ld\+json">([\s\S]*?)<\/script>/g;let m,n=0;
 while((m=re.exec(h))){const j=JSON.parse(m[1]);for(const o of [].concat(j))console.log(o["@context"],o["@type"]);n++}
 if(n===0)process.exit(1)})'
If JSON.parse throws, print the raw text of the failing block and point at the character it stops on.
Find where each block is generated or pasted in the code and show me the lines.
List what it would take to make every block parse with @context and @type, without editing anything.
Verify: the parse check prints one line per block with no error and every line shows https://schema.org and a type; if not, report the failing block and stop.

Next

Grade your own URL

Every grade lists this check with its evidence for your site. Two free grades a day.