Guides/Next.js SEO: Rendering, Metadata, and the Render-Diff Traps
Guide

Next.js SEO: Rendering Strategy, Metadata, and Common CSR Traps

Next.js can serve fully indexable HTML or ship an empty CSR shell. A technical guide to SSR/SSG/ISR, the App Router metadata API, canonical and hreflang, dynamic sitemaps, and render-diff traps.

Next.js can produce four different documents from the same component tree — server-rendered per request, statically generated at build, incrementally regenerated, or client-rendered in the browser — and only three of them put your content in the HTML Google crawls first. Google reads raw HTML on the first pass and renders JavaScript later, on a separate queue with real limits. The core Next.js SEO decision is choosing a rendering mode that ships real content and metadata in the initial response, then confirming the framework did what you configured — because it silently falls back to client rendering more often than developers expect.

The four rendering modes and what Google sees

Google's pipeline is crawl, then render, then index. The crawler parses your raw HTML and queues the <a href> links it finds; JavaScript execution happens later in the Web Rendering Service, and the rendered snapshot is what gets indexed. Where your content lives in that sequence depends on the mode:

The first three are safe for search. CSR is the source of nearly every Next.js SEO failure below. Bing renders JavaScript far less reliably than Google, so CSR content may never make it into Bing at all.

The render-diff traps

Because raw HTML and rendered HTML are two different documents, the most damaging Next.js problems are the ones where they diverge. Crawlinx fetches both and diffs them, which is how these surface:

The mechanics behind all of these are in our JavaScript SEO and rendering guide.

The Metadata API

The App Router generates <head> tags from a metadata export or an async generateMetadata function that runs on the server. Use it — it guarantees title, description, canonical, robots, Open Graph, and hreflang land in the raw HTML rather than being set client-side.

In the older Pages Router the equivalent is a server-rendered next/head; the same principle holds — metadata must be in the server output.

Canonical and hreflang in the App Router

alternates.canonical and alternates.languages in the Metadata API emit the canonical and hreflang <link> tags server-side. For internationalized routing (/en/, /de/), generate the hreflang set from generateMetadata so every localized route lists itself and all alternates. The three non-negotiable hreflang rules still apply: return tags must be bidirectional, every version must be self-referential, and URLs must be fully qualified and absolute. Our hreflang guide covers the codes and common breakage. Do not auto-redirect by IP in middleware — Googlebot crawls mostly from the US and may never see the regional variant; use distinct URLs plus hreflang and a user-selectable switcher.

Dynamic routes and sitemaps

For dynamic segments, prebuild what you can with generateStaticParams so the routes exist as static HTML rather than rendering on first request. Generate sitemap.xml from a sitemap.ts file that reads your data source, so the sitemap tracks your real catalog instead of a hand-maintained list. Two things to verify: that every URL in the generated sitemap is indexable (not noindex, returns 200), and that the routes it lists are actually reachable through crawlable server-rendered <a href> links, not only through a client-side router.

Hydration and common CSR-only pitfalls

Hydration — shipping server HTML then attaching interactivity — is the healthy default and is fine for SEO because the content is already in the raw response. The pitfalls are the shortcuts that quietly opt out of it:

Verify with URL Inspection's Rendered HTML view and by diffing raw against rendered, not with client-side analytics, which undercount Googlebot.

Takeaway

Next.js gives you fully indexable HTML for free through SSR, SSG, or ISR — the failures come from accidentally falling back to CSR and from setting metadata on the client instead of the server. Choose a server-rendering mode for content routes, emit title, canonical, robots, and hreflang through the Metadata API, generate sitemaps from your data, and diff raw against rendered HTML to catch what only your users can see. Run the technical SEO audit checklist against a deployed build to confirm the framework shipped what you configured.

Related
JavaScript SEO: How Google Renders JS Pages (and Where It Breaks) Technical SEO Audit Checklist Canonical Tags Guide: rel=canonical Explained Hreflang and International SEO: A Practical Guide render.content_js_only render.links_js_only render.title_changed render.canonical_changed render.robots_changed rendering.js_dependent canonical.missing index.noindex links.orphan

Audit your own site — free

77 checks, internal PageRank, render-diff. No signup, results in ~30s.

Scan your site →