Schema.org markup passes basic validity checks
Why it matters
A JSON syntax error in any <script type="application/ld+json"> block silently discards the entire schema — Google logs a parse failure and ignores the block, removing that page from Rich Results eligibility. Beyond syntax, schema-org Article and schema-org WebSite define required properties that must be present for Google to trust and surface the markup: an Article missing datePublished will not appear in Top Stories carousels regardless of content quality. Invalid structured data is equivalent to no structured data from Google's perspective, making this a direct ranking signal failure.
Severity rationale
High because any syntactically invalid JSON-LD block or missing required property silently disqualifies that page from Rich Results, wasting implementation effort and suppressing SERP visibility.
Remediation
Lint all JSON-LD before embedding. The fastest fix is running each block through JSON.parse() in a build-time script or using the Google Rich Results Test against your staging URL. For BlogPosting, the required fields are headline, author (with @type: "Person" and name), datePublished, and image. For WebSite, the minimum is name and url.
Add a validation step in src/lib/schema.ts that asserts required fields at build time:
// src/lib/schema.ts
export function buildArticleSchema(post: Post) {
if (!post.title || !post.publishedAt || !post.authorName) {
throw new Error(`Article schema: missing required fields for "${post.slug}"`);
}
return {
'@context': 'https://schema.org',
'@type': 'BlogPosting',
headline: post.title,
datePublished: post.publishedAt,
author: { '@type': 'Person', name: post.authorName },
};
}
This catches missing properties at build time rather than silently shipping invalid schema to production.
Detection
-
ID:
schema-validity -
Severity:
high -
What to look for: Count all JSON-LD blocks and enumerate which pass JSON parsing and which have syntax errors or missing required properties. Examine all
<script type="application/ld+json">blocks found in the project. Parse each as JSON and check: (1) JSON is syntactically valid (parseable without errors), (2) each block has a@contextfield set to"https://schema.org"or"http://schema.org", (3) each block has a@typefield, (4) required properties for the given@typeare present. For common types:WebSiterequiresname;Article/BlogPostingrequiresheadline,author,datePublished;BreadcrumbListrequiresitemListElement;Organizationrequiresname. -
Pass criteria: All JSON-LD blocks are valid JSON, have
@contextand@type, and include the required properties for their type. At least 90% of JSON-LD blocks must be syntactically valid with required properties present. -
Fail criteria: Any JSON-LD block has a JSON syntax error, missing
@contextor@type, or is missing a required property for its declared type. -
Skip (N/A) when: No JSON-LD blocks found in the project (caught by
jsonld-presentcheck). -
Cross-reference: For structured data content matching, see
markup-content-match. -
Detail on fail: Identify the specific file, the @type, and the validation failure. Example:
"Article schema in app/blog/[slug]/page.tsx is missing required 'datePublished' field. Organization schema has JSON syntax error near character 247." -
Remediation: Invalid structured data does not produce rich results and may be ignored by search engines entirely. Fix syntax errors by linting your JSON-LD objects before embedding them. For
BlogPosting, required fields are:headline,author(with@type: Personandname),datePublished,dateModified, anddescription. Consult schema.org for required properties of other types.// Validate with Google Rich Results Test — fix missing properties in app/page.tsx JSON-LD blocks { "@context": "https://schema.org", "@type": "Organization", "name": "Required", "url": "Required" }
External references
- schema-org · Article — Article/BlogPosting required properties validation
- schema-org · WebSite — WebSite required properties validation
Taxons
History
- 2026-04-18·v1.0.0·Initial import from marketing-advanced-seo·automated