Next.js SEO
Next.js SEO is the practice of configuring a Next.js site so search engines can efficiently crawl, render, index, and rank its pages using server-rendered or statically generated HTML, metadata, structured data, and performance optimizations.

Key takeaways
- Next.js SEO uses SSR or SSG to pre-render HTML for crawlers.
- Metadata API manages titles, descriptions, and Open Graph tags.
- Structured data (JSON-LD) helps rich results eligibility.
- Performance optimizations improve Core Web Vitals.
- Sitemaps and robots.txt are generated via file conventions.
Server-side rendering and static generation are central because they pre-render HTML that search engines can process more easily.
Example
A Next.js e-commerce site uses SSG for product pages, the Metadata API to set unique titles and descriptions per product, JSON-LD for product schema, and generates a sitemap.xml automatically. This helps Google index each product quickly and show rich results with prices and reviews.
When should I use this?
- You are building a new Next.js site and want search engines to find your content.
- You have a JavaScript-heavy site that struggles with indexing.
- You need to improve Core Web Vitals and page speed.
- You want to manage metadata and structured data efficiently.
What it is not
- Not a magic bullet: Next.js alone won't rank your pages without quality content and backlinks.
- Not a replacement for SEO fundamentals: you still need keyword research, internal linking, and user-friendly URLs.
- Not only about SSR: SSG and ISR are also valid rendering strategies.
Quick start
- Choose a rendering method: SSR for dynamic pages, SSG for static content.
- Use the Metadata API to set unique title and description for each page.
- Add JSON-LD structured data in layout or page components.
- Generate sitemap.xml and robots.txt via file conventions.
- Optimize images with next/image and monitor Core Web Vitals.
Common mistakes
- Relying on client-side rendering for important content that should be visible to crawlers.
- Using the same title, description, or canonical logic across many pages instead of unique page-level metadata.
- Ignoring performance issues such as large bundles, slow images, or unnecessary client JavaScript.
- Forgetting sitemap and robots setup, which can slow discovery and indexing.
Next step
FAQ
Does Next.js automatically improve SEO?
Next.js provides built-in tools like SSR, SSG, and the Metadata API that can improve SEO, but you still need to configure them correctly and follow SEO best practices.
What is the best rendering method for SEO in Next.js?
SSR and SSG are both effective. SSG is best for static content, SSR for dynamic pages that need fresh data. Avoid client-side rendering for critical content.
Related topics
Sources
- Next.js Learn: Why is SEO so important? — Official Next.js explanation of the technical, content, and popularity pillars of SEO.
- Google Search Central: SEO Starter Guide — Google's primary reference for foundational SEO best practices.
- Google Search Central: Rendering on Google Search — Best source for JavaScript, rendering, and crawl/index behavior relevant to Next.js.
- Google Search Central: Structured data introduction — Official guidance on JSON-LD and rich result eligibility.
- Google Search Central: Sitemaps overview — Authoritative source for sitemap use and discovery.
Reviewed by Lucía Marín, Founding editor.