Next.js SEO: App Router Metadata, Rendering & Best Practices
A practical Next.js App Router SEO guide to metadata, dynamic routes, rendering, canonical URLs, sitemaps, and structured data.

How Next.js App Router handles SEO
The Next.js App Router provides server and client rendering options, metadata APIs, and file-based routing. Search visibility still depends on accessible, useful page content and correct technical implementation.
Use this framework guide alongside the broader technical SEO audit checklist when reviewing a Next.js site. For custom implementation, see our Next.js web development service.
Rendering and crawlable page content
Server-rendered output can make important content available in the initial response. Verify the rendered HTML and test client-rendered routes as well; framework choice alone does not guarantee crawlability or indexing.
Configure metadata for static and dynamic routes
For a route whose metadata depends on its slug or CMS data, use generateMetadata in a Server Component. In current App Router versions, route parameters are asynchronous. Handle missing records deliberately and return metadata that describes the actual page. See the Next.js Metadata API reference.
type Props = { params: Promise<{ slug: string }> };
export async function generateMetadata({ params }: Props): Promise<Metadata> {
const { slug } = await params;
const post = await getPost(slug);
return {
title: post.title,
alternates: { canonical: `/blog/${slug}` },
};
}
Use one canonical URL convention across the site: host, trailing slash, locale, and query-string behavior should agree with redirects and internal links. Avoid generating a canonical URL from a value that has not been validated against the route.
Check robots.txt and sitemap output
The App Router supports robots.ts and sitemap.ts file conventions. Review their actual production output after deployment. Keep the sitemap focused on canonical public pages that should be discovered, and make sure robots rules do not block resources or routes that search crawlers need to access. Read the robots file documentation and sitemap documentation.
Validate dynamic routes and rendered content
- Test a representative static page and several data-driven routes, including a missing or unpublished slug.
- Inspect the production page for the expected title, description, canonical, heading, main copy, and internal links.
- Check that metadata and visible content come from the same record and do not diverge after a CMS update.
- Compare the sitemap URLs with the route inventory and the canonical URL shown on each page.
- Review redirect and not-found behavior during a migration; avoid returning a successful page status for content that is actually missing.
For a broader site review, use the Next.js technical SEO audit checklist and our crawlability and indexing guide.
Core Web Vitals as a Ranking Factor
Measure performance on representative routes with lab and field data. Image optimization, reducing unnecessary JavaScript, and caching can help, but results depend on the application and hosting setup. See our Core Web Vitals optimization guide.
Need a search-friendly Next.js build?
We build Next.js applications with crawlability, metadata, and performance considered from the start.
View custom build pricing
