jsonld.valid
- Default
- error
- Plugin
jsonld
Each JSON-LD script is valid JSON, with an @context and an @type.
Why: Search engines read structured data from JSON-LD, the format that Google recommends, to show rich results. A JSON-LD script that does not parse, or that lacks an @context or an @type, is ignored, and nothing on the page shows it. The rule does not check the properties of each type; use Google's Rich Results Test for that.
An @graph of items also passes, when each item has an @type.
When off: any JSON-LD script passes.
<!-- ✗ Fails -->
<script type="application/ld+json">
{ "@type": "Article", "headline": "Our sourdough" }
</script>
<!-- ✓ Passes -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Article",
"headline": "Our sourdough"
}
</script>
References
- Google: Structured data guidelines: Google recommends JSON-LD, and items that miss required properties are not eligible for rich results.
- Google: Introduction to structured data: How Google reads structured data.
- W3C: JSON-LD 1.1: The JSON-LD format, with
@context,@type, and@graph.