Updated 22 Nov 2026 · 4 min read
Next.js App Router: a canonical in the root layout canonicalises every page to the homepage
In the Next.js App Router, metadata merges shallowly and inner pages inherit the root layout's alternates.canonical. One canonical set in app/layout.tsx tells search engines every page is a copy of the homepage. Set a relative, self-referencing canonical per page, and fix OG, 404 robots and sitemap dates the same way.