⭐ Beginner — No coding experience needed
JSON-LD for Beginners: Why It Must Be Valid
Learn what JSON-LD is, why even one missing comma can stop Google from reading your schema, and how to validate it before publishing.
What you will learn in this guide
- What JSON-LD is and where it sits in your HTML
- Common JSON syntax errors and why they break schema
- How to validate JSON-LD before publishing
- How to fix the 5 most common errors
- How Google handles invalid JSON-LD (silently ignored)
1 What is JSON-LD?
JSON-LD is a way of describing your page content to search engines in a structured format. It sits in a <script type="application/ld+json"> tag in the head or body of your HTML.
Why JSON-LD must be valid:Google ignores invalid JSON-LD silently. You get no warning, no email, no Search Console alert. The rich results just stop appearing. Validation before publishing is essential.
2 The 5 most common JSON errors
| Error | Example | Fix |
|---|---|---|
| Trailing comma | {"a":1,"b":2,} | Remove the comma before } |
| Missing comma between properties | {"a":1 "b":2} | Add comma between key-value pairs |
| Unescaped quotes inside strings | "name":"O'Reilly" with raw apostrophe is fine; "name":"He said "hi"" is not | Escape inner quotes: \" |
| Single quotes instead of double | {'a':1} | JSON requires double quotes around keys and string values |
| Unquoted keys | {a:1} | Always quote keys: {"a":1} |
3 How to validate your JSON-LD
- 1Copy your JSON-LD blockFrom your page source, copy everything between
<script type="application/ld+json">and</script>. - 2Paste into the JSON ValidatorOpen schema-tools.html#json-checker and paste your snippet. The tool reports the line and column of any error.
- 3Run Google's Rich Results TestEven if JSON is valid, Google may reject the schema for missing required fields. Use Google's tool to confirm rich-result eligibility.
- 4Fix and re-testRe-validate after every change. Don't publish until both validators pass cleanly.
4 When automation breaks JSON
Most schema problems come from generators that build JSON from a template. Watch for:
- Smart quotes from a CMS WYSIWYG (curly quotes break JSON)
- User-supplied content with unescaped quotes (product reviews, author names)
- Currency symbols entered as HTML entities instead of plain chars
- Missing fallback values when a field is empty
Always log your JSON-LD outputto a server log on staging before going live. Many WordPress sites silently break schema on every plugin update.