Find the broken JSON-LD block in a storefront page
Admin ·
A storefront template may place product information in its head and breadcrumbs in a second script near the page content. Checking the complete saved HTML shows which block parses and where the other one needs an edit.
Find both script blocks by their opening lines
Select Load example. The Product block starts on line 5 in the head and passes the JSON syntax check. The BreadcrumbList block starts on line 11 in the body. It reports one syntax error.
Expand View extracted source for the second block. Inspect the line ending in a comma just above the closing brace. Line numbers in findings refer to the supplied HTML, so they stay useful when you trace an issue back to a template.
W3C JSON-LD 1.1, embedding JSON-LD in HTML documentsW3C JSON-LD 1.1 grammar
Remove the trailing comma and check the page again
Remove the comma at the end of the itemListElement line. Select Check HTML again. Both blocks should pass JSON syntax with zero errors and zero warnings. The first block lists Product. The second lists BreadcrumbList and its nested ListItem.
Download the report to keep the source from both scripts, their opening and closing lines, and their individual findings. The blocks are listed in source order, even when markup places them in different parts of the page.
W3C JSON-LD 1.1, embedding JSON-LD in HTML documentsW3C JSON-LD 1.1 grammar
Review the sample’s Product and breadcrumb fields
Enable Review common Schema.org fields, then select Check HTML. The Product sample supplies a name. The optional review also looks for an offers, review or aggregateRating object or reference.
The breadcrumb sample has one ListItem. Google’s breadcrumb guidance calls for at least two. For literal ListItem entries, the review checks an integer position, a label from name, and an item address or reference for each entry before the last.
Paste a raw JSON-LD object to focus on one block and use Check JSON-LD. Run the field review on an edited copy to confirm which warnings it resolves.
Google Search Central, Product snippet fieldsGoogle Search Central, BreadcrumbList and ListItem fields
Use the published page to verify search eligibility
If a release step generates the script, save a copy that contains it and check that copy. The optional local field review uses literal names and selected Google guidance.
Use the search provider’s published-page inspection to check complete vocabulary, content, access and feature eligibility.
Common questions
Why does a commented or templated script stay out of the report?
The checker extracts inline script elements from the parsed HTML head and body. A comment or inert template holds markup that does not appear there as a document script.
Can this report validate Microdata or RDFa?
It checks inline JSON-LD scripts. Use a structured data processor that supports Microdata or RDFa for those formats.
Sources
Put it into practice.
Related guides
- How to Fix an Invalid JSON-LD Type Array
- How to Create and Check FAQPage Markup
- Find Duplicate Titles and Meta Descriptions
- Create HowTo JSON-LD From Numbered Steps
- Add Course and Session Structured Data
- Mark Up an Event and Its Ticket Offer
- Mark Up a Remote or On-Site Job
- Create Recipe JSON-LD From a Worked Recipe
- Create SoftwareApplication JSON-LD
- Validate Organization Links and Logos
- Create VideoObject JSON-LD