Google indexing guide for Next.js
A React framework. Server-side and static generation hand Googlebot ready-made HTML; metadata is managed with the Metadata API.
Contents
Where are the settings?
The metadata object in app/layout.tsx and page files, app/robots.ts, app/sitemap.ts and next.config.js.
Settings that affect indexing
- noindex and visibility: Look for robots: { index: false } in metadata; a condition tied to an environment variable can output noindex in production by mistake. Also check that no X-Robots-Tag response header is added.
- robots.txt: Check app/robots.ts or public/robots.txt. If you disallow preview environments, confirm the same rule does not ship to production.
- canonical and duplicate URLs: Give every page an absolute canonical with metadata.alternates.canonical and set metadataBase. On dynamic routes make sure parametrised URLs do not repeat content.
- redirects and 404: Define permanent (permanent: true) redirects with redirects() in next.config.js and avoid chains and loops. On missing routes return a real 404 with notFound().
- sitemap: Generate a dynamic sitemap with app/sitemap.ts; split large sites with generateSitemaps. List only canonical URLs that return 200.
- speed and crawling: Render pages statically or with ISR where possible, split heavy client bundles and use next/image. Slow server responses reduce crawl rate.
Common indexing problems on Next.js
Open the matching page for steps specific to each status:
- Crawled - currently not indexed
- Discovered - currently not indexed
- Duplicate without user-selected canonical
- Duplicate, Google chose different canonical than user
- Alternate page with proper canonical tag
- Page with redirect
- Soft 404
- Not found (404)
- Blocked by robots.txt
- Excluded by 'noindex' tag
- Server error (5xx)
- Redirect error
- Indexed, though blocked by robots.txt
- Blocked due to unauthorized request (401) / access forbidden (403)
- URL is unknown to Google
- Indexed, not submitted in sitemap
Next steps
Before publishing, run through Google indexing checklist: 15 items before you publish, scan the address with the free Free indexability checker tool and add new pages to the sitemap: How to build a sitemap and submit it to Search Console. For many pages, Google index panel: send, track and resend from one screen makes bulk submission easier; indexing is never guaranteed.
Frequently asked questions
Why is my Next.js site not showing on Google?
Usually because of a noindex setting, a robots.txt block, a missing sitemap or weak content. Check the settings above and the matching status pages in order.
What is the sitemap address for Next.js?
Generate a dynamic sitemap with app/sitemap.ts; split large sites with generateSitemaps. List only canonical URLs that return 200.