How to fix “Not found (404)” on Next.js
If Search Console shows “Not found (404)” on your Next.js site, you are in the right place. The URL returns 404. This page covers the causes and a step-by-step fix for Next.js. A React framework. Server-side and static generation hand Googlebot ready-made HTML; metadata is managed with the Metadata API.
Contents
What does this status mean?
Googlebot visited and the server answered "not found". If you removed the page on purpose this is normal and it will drop out over time; if not, something is wrong with a link, a redirect or publishing.
Likely causes on Next.js
- The page was deleted or its URL changed without a redirect.
- The sitemap or internal links list addresses that no longer exist.
- Links from other sites point at mistyped addresses.
- A temporary publishing or cache problem made the page 404 for a while.
- Next.js note: 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().
Step-by-step fix on Next.js
- In your Next.js admin go to: The metadata object in app/layout.tsx and page files, app/robots.ts, app/sitemap.ts and next.config.js.
- 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().
- Generate a dynamic sitemap with app/sitemap.ts; split large sites with generateSitemaps. List only canonical URLs that return 200.
- If the page is gone for good, leave the 404 or 410 as it is; that is not wrong.
- If a similar page exists, add a 301 redirect.
- Remove deleted addresses from the sitemap and internal links.
- Redirect externally linked 404s to a relevant page with 301 to keep their link value.
- If the page should exist, republish it and verify with URL inspection.
Extra checks for Next.js
- 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.
After fixing
In Search Console start "Validate fix" for this status and resubmit the page with URL inspection. First confirm the blocker is gone with the free Free indexability checker tool; for many URLs follow Bulk URL indexing: how to send thousands of pages to Google. Google makes the indexing decision itself and timing ranges from days to weeks.
More information
Frequently asked questions
Do 404s hurt my rankings?
Normal 404s do not. Important pages returning 404 by mistake lose traffic.
Should I redirect them all?
No. Redirect only URLs that have a real counterpart; redirecting to an unrelated page can count as a soft 404.
Where are these settings on Next.js?
The metadata object in app/layout.tsx and page files, app/robots.ts, app/sitemap.ts and next.config.js.