Skip to content

seo: move site-wide JSON-LD from body to head (cherry-pick) - #609

Merged
Flotapponnier merged 1 commit into
mainfrom
seo/jsonld-head-main
Jun 21, 2026
Merged

seo: move site-wide JSON-LD from body to head (cherry-pick)#609
Flotapponnier merged 1 commit into
mainfrom
seo/jsonld-head-main

Conversation

@Flotapponnier

Copy link
Copy Markdown
Collaborator

Cherry-pick of #608 from dev onto main.

Scope

Single-file change in src/app/layout.tsx. Moves the site-wide Organization + WebSite JSON-LD block from the first child of <body> into the root <head>.

Rationale

Google parses JSON-LD in both <head> and <body>. Stricter parsers (some AI search crawlers, schema validators) only scan <head>. Placing the Organization block (brand entity, logo, contactPoint, sameAs with Wikidata anchor, SearchAction) in <head> makes it visible to head-only parsers on every page.

Pure placement change. Serialized JSON is byte-identical to the previous output.

Per-page JSON-LD scope note

Original brief included moving per-page Dataset/TechArticle/Breadcrumb/FAQPage blocks. Verified against node_modules/next/dist/docs/01-app/02-guides/json-ld.md and react-dom source: inline <script> rendered from a page component cannot be hoisted to <head> in Next 16 + React 19 App Router (page renders inside body, React 19 only hoists <script src async> resource scripts, next/script with beforeInteractive serializes to a __next_s.push in body, metadata other field only emits <meta>, React.cache is not shared between metadata and render). Per-page blocks remain in <body>. Google rich results coverage is unaffected.

See #608 for the full verification matrix (head vs body counts per prerendered page).

@Flotapponnier
Flotapponnier merged commit 2812f10 into main Jun 21, 2026
1 check passed
@Flotapponnier
Flotapponnier deleted the seo/jsonld-head-main branch June 21, 2026 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant