How to Fix 404 Errors in Google Search Console: A Developer's Triage (301, 410 or Ignore)
Fix 404 errors in Google Search Console after you delete, prune or merge pages: triage each URL, choose 301, 410 or ignore, ship redirects, then validate.
To fix 404 errors in Google Search Console, open Indexing > Pages > "Not found (404)", export the URLs, and sort each one into three buckets: a page that moved (add a 301 to the one page that replaced it), a page you deleted on purpose (leave the 404 or return 410), or a URL that never existed (ignore it). Then fix any internal links that still point at dead URLs, deploy, and click Validate Fix only for the URLs you changed. Most 404s in the report need no fix at all.
This guide is for a developer who runs a blog or docs site from a repo (Next.js, MDX, deployed on Vercel or similar) and has just deleted, renamed, pruned or merged pages. That is when the 404 report fills up, and when the wrong fix (redirect everything to the homepage) does the most harm.
Where the 404 report lives and what it actually means
In Search Console, go to Indexing > Pages. Under "Why pages aren't indexed" you will see a row called Not found (404). Click it to get the list of URLs and the date Google last crawled each one.
Three things to know before you touch anything:
- The report is a crawl log, not an error list. It lists every URL Googlebot requested and got a 404 for. That includes URLs you removed on purpose and URLs that never existed.
- A 404 is the correct answer for a page that is gone. Google's own documentation says 404s do not hurt the rest of your site's rankings. The report is informational.
- It lags. URLs can sit in the report for weeks after you fixed them, until Googlebot recrawls them.
So the job is not "make the number zero". The job is to find the few 404s that cost you something and fix those.
Triage: 301, 410 or leave it
Export the list (the export button is at the top right of the report) and go through it with this table:
| What the URL is | Signal to check | Fix | Validate? | |---|---|---|---| | A page you renamed or moved | You know the new URL; old URL has backlinks or past clicks | 301 to the new URL | Yes | | A page you merged into another | The content now lives on a keeper page | 301 to the keeper | Yes | | A page you deleted, with no replacement | No page answers the same query | Leave 404, or return 410 | No | | A URL that should exist but 404s | It is in your sitemap or nav; the file exists in the repo | Fix the route, build or slug bug | Yes | | A URL that never existed | Typo, scraper link, malformed path, old query string | Nothing | No | | An internal link to a dead URL | Your own page links to it (check the referring page in URL Inspection) | Update the link in the source page | Yes |
Two rules keep this honest:
- Redirect only to an equivalent page. If no page on the site answers the same search intent, a redirect is the wrong tool. Google treats redirects to irrelevant pages (the homepage, a category page) as soft 404s, so you get the same outcome as a 404 plus a confused user.
- Fix your own links first. A 404 that your own nav, sitemap or article body links to is the only kind that is fully your fault and fully in your control. Search the repo for the dead path before deciding anything else.
Check a single URL before you decide
For any URL you are unsure about, paste it into URL Inspection at the top of Search Console. It shows whether Google knows of referring pages and sitemaps for that URL, and lets you run a live test to see what status code the URL returns right now.
From the terminal, the same check is one command:
curl -sI https://www.example.com/blog/old-post | head -5
You want to see HTTP/2 404 (or 410) for gone pages, and HTTP/2 308 or 301 plus a location: header for moved ones. If you expected a redirect and see a 404, your redirect rule is not deployed or does not match.
Ship the redirects in code
On a repo-based site, redirects belong in the repo, reviewed like any other change.
Vercel (vercel.json):
{
"redirects": [
{
"source": "/blog/old-post",
"destination": "/blog/new-post",
"permanent": true
}
]
}
permanent: true makes Vercel answer with a 308, which Google treats as a permanent redirect, the same as a 301.
Next.js (next.config.js):
module.exports = {
async redirects() {
return [
{ source: "/blog/old-post", destination: "/blog/new-post", permanent: true },
];
},
};
Returning 410 in Next.js. There is no config flag for 410. A small middleware does it for a known list of removed paths:
// middleware.ts
import { NextResponse, type NextRequest } from "next/server";
const GONE = new Set(["/blog/removed-post", "/blog/another-removed-post"]);
export function middleware(req: NextRequest) {
if (GONE.has(req.nextUrl.pathname)) {
return new NextResponse(null, { status: 410 });
}
return NextResponse.next();
}
For an MDX blog where a missing file should simply 404, call notFound() from next/navigation when the slug has no post. That returns a real 404 status, not a 200 page that says "not found" (which Google reports as a soft 404).
Avoid redirect chains. When you redirect A to B and later B to C, update the A rule to point straight at C. Each extra hop is a request Googlebot has to make, and long chains may not be followed to the end.
Deleting vs noindexing vs merging: pick before you remove a page
Most 404 work is self-inflicted: a page got deleted when it should have been merged or noindexed. Decide which one you are doing before you remove anything.
| Action | URL after | Status code | Shows in 404 report? | Use when |
|---|---|---|---|---|
| Delete the file | Gone | 404 (or 410 if you add it) | Yes | The page had no traffic, no links, and no replacement |
| Noindex the page | Still live | 200, with noindex | No (shows under "Excluded by noindex tag") | The page is weak in search but still useful to visitors or linked from elsewhere |
| Merge into a keeper | Redirects | 301/308 to keeper | No | Two pages compete for the same query; one holds the best content |
This is the split our own SEO agent works by. The rails in the PageSeeds run skill read:
- Never noindex, redirect or delete a page by hand; code owns those.
prune, target a slug:prune-submit -i <id> -S <slug>(code sets noindex).
Pruning a weak page sets noindex and keeps the URL live, so a prune never creates a 404 to clean up. A merge folds the old page's content into a keeper, and the merge lane owns the 301. Nothing in the loop deletes a published URL outright. If you run your blog from a repo, the same split is a good default for a human too: noindex first, merge when there is a real keeper, delete only when the page is worthless and nothing links to it.
Validate the fix, then stop watching it
Once your redirects and link fixes are deployed:
- Spot-check a few URLs with
curl -sIor URL Inspection's live test. - In the "Not found (404)" report, click Validate Fix. Google says validation usually takes up to about two weeks and can take longer.
- Do not validate URLs you intend to stay 404 or 410. They will correctly fail, and that is fine.
If the report keeps growing with URLs you have never seen, look at the pattern: a broken link generator in a template, an old sitemap still submitted, or another site linking to a malformed path. Fix the source if it is yours; ignore it if it is not.
Doing this from the terminal
Every step above that changes something is a code change: a line in vercel.json, a middleware entry, a link fixed in an MDX file. That makes 404 triage a good job for a coding agent, as long as it reads real Search Console data and ships the change as a pull request you review. For the rest of a repo-based setup, see the Next.js SEO checklist. For running Search Console data through the terminal, see what an SEO CLI is, and for the weekly routine this triage fits into, the 120-minute weekly SEO workflow. If you want the loop run for you, PageSeeds Hosted is $99/month per site.
FAQ
Do 404 errors in Google Search Console hurt my rankings?
Not by themselves. Google documents 404s as a normal part of the web. They matter only when the missing URL had backlinks, traffic, or internal links pointing at it, or when a page that should exist is returning 404 by mistake.
Should I redirect every 404 to my homepage?
No. Google usually treats a redirect to an unrelated page as a soft 404. Redirect only to a page that answers the same question; otherwise let the URL return 404 or 410.
What is the difference between a 404 and a 410 for Google?
Both tell Google the page is gone. 410 says the removal is deliberate and Google may drop the URL slightly sooner, but in practice the two are handled almost the same.
How long does Validate Fix take in Search Console?
Google says up to about two weeks, sometimes longer. You do not need to validate URLs that are meant to stay 404.
Why do 404s show up for URLs I never created?
Googlebot follows links it finds anywhere, including other sites, old sitemaps and malformed URLs in scripts. If the URL never existed on your site and has no real backlinks, leave it as a 404.
$99/month per site
Frequently Asked Questions
Do 404 errors in Google Search Console hurt my rankings?
Not by themselves. Google documents 404s as a normal part of the web: a URL that no longer exists should return 404, and the rest of the site is not penalized for it. They matter only when the missing URL had backlinks, traffic, or internal links pointing at it, or when a page that should exist is returning 404 by mistake.
Should I redirect every 404 to my homepage?
No. A redirect to an unrelated page, such as the homepage, is usually treated by Google as a soft 404, so you gain nothing and confuse users. Redirect only to a page that answers the same question; otherwise let the URL return 404 or 410.
What is the difference between a 404 and a 410 for Google?
Both tell Google the page is gone and both lead to the URL being dropped from the index. 410 says the removal is deliberate and permanent, and Google may drop it slightly sooner, but in practice the two are handled almost the same. Use 410 when you want to be explicit; 404 is fine otherwise.
How long does Validate Fix take in Search Console?
Google says validation usually takes up to about two weeks and can take longer. Search Console recrawls the affected URLs over that period and marks the issue passed or failed. You do not need to validate URLs that are meant to stay 404.
Why do 404s show up for URLs I never created?
Googlebot follows links it finds anywhere, including other sites, old sitemaps, and malformed URLs in scripts. If the URL never existed on your site and has no real backlinks, leave it as a 404; there is nothing to fix.