squirrelscan
GitHub

What is structured data? JSON-LD, schema.org and checks

Structured data is machine-readable markup, usually schema.org in JSON-LD, that describes a page's content to search engines and agents. What to check.

Structured data is machine-readable markup that describes what a page is about, such as an article, a product or the organization behind a site, usually written in schema.org vocabulary as JSON-LD.

Google supports three formats, JSON-LD, Microdata and RDFa, and recommends JSON-LD because it sits in a <script> block apart from the visible text. Whatever the format, the markup has to describe the same thing the page shows: Google’s guidelines say that if the JSON-LD describes a performer, the HTML body must describe that same performer.

Category: Structured Data

Why it matters

Search engines build rich results, such as review stars, product prices and event dates, from structured data, and a page has to be in the index for them to appear. Markup on a page that is noindex or blocked in robots.txt produces nothing. A block with a syntax error is unreadable as a whole. Google also says structured data is not required for its generative AI search features.

How squirrelscan checks it

schema/json-ld-valid parses every JSON-LD block on a page and validates it against the properties each type needs. The type rules, such as schema/article, schema/product and schema/organization, check the required and recommended properties for their type. schema/coverage-outlier groups pages by type and reports the ones missing markup that their same-type siblings carry, which usually points at one template. crawl/schema-noindex-conflict flags pages with rich-result types that are blocked from indexing.

RuleWhat it flagsSeverity
Invalid JSON-LD syntax: what breaks it and how to fixA structured data block that will not parse, or parses but omits properties schema.org requires. squirrel names the exact type and property.warning
Structured data coverage: pages that break your own normForty of forty-five product pages carry Product markup and five do not. squirrel finds the gap against the site’s own pattern, not a generic rule.warning
Rich result schema on a noindexed page: wasted markupStructured data on a page search engines cannot index will never produce a rich result. squirrel finds pages carrying both.error
Article schema: headline, author and datePublished checksArticle JSON-LD missing headline, author or datePublished, or carrying a date that is not ISO 8601. squirrel checks both on every page.warning
Product schema: name, image, offers and review checksProduct markup with no name or image, an Offer missing price or availability, and no rating data. squirrel checks each product page.warning
Organization schema: name, url, logo and sameAs checksOrganization JSON-LD missing name or url, with no logo, or a sameAs list that omits a social profile the site clearly runs. squirrel finds all three.info

How to fix it

Emit the block from a real object with JSON.stringify rather than a string template, which is where trailing commas and unescaped quotes come from (see the JSON-LD fix):

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Organization",
  "name": "Acme Coffee",
  "url": "https://example.com/"
}
</script>

Then fix the pages the coverage check lists by sending them through the same template branch as the pages that pass. squirrelscan reads the HTML the server sent, so JSON-LD injected by client-side JavaScript only counts when browser rendering is on.

Run the check

squirrel audit https://example.com --rule-include schema/json-ld-valid,schema/coverage-outlier,crawl/schema-noindex-conflict,schema/article,schema/product,schema/organization

A signed-out local audit costs nothing.

  • JSON-LD: JSON for Linking Data, the format Google recommends for structured data, embedded in a <script type="application/ld+json"> block.
  • Rich results: Search result features (stars, breadcrumbs, product prices, video thumbnails) that Google can show when a page has eligible structured data.
  • Entity: A thing a site describes in structured data, such as an organization, person or product, identified across pages so search engines and agents can tell it is one thing.

References

Type to search…

↑↓ navigate↵ openesc close