Guides
How to Find and Fix 404 Errors on Your Site
Finding 404s is easy. The judgement is deciding which ones matter: a 404 on a URL nobody ever linked to is working as designed.
Lancez un audit DomainLens frais et utilisez le rapport comme liste de priorités.
Four sources, four different answers
Use more than one. Search Console tells you what Google noticed, a crawl tells you what your own site links to, and logs tell you what is genuinely being requested — including URLs from external links you never knew existed.
| Source | Finds | Blind spot |
|---|---|---|
| Search Console | 404s Google encountered | Only URLs Google knows about |
| A site crawl | Broken internal links | Nothing about external links |
| Server logs | Every 404 actually requested | Needs log access and filtering |
| Analytics | 404s real visitors hit | Only if the page is tracked |
Triage before fixing
Not every 404 is a defect, and treating them all as one is how sites end up with hundreds of pointless redirects. Sort them first.
- Linked internally — always fix, by correcting the link. This is a genuine bug in your own site.
- Linked externally from a real site — redirect to the closest equivalent page, so the link keeps its value.
- Previously indexed with traffic — redirect if there is a genuine equivalent; otherwise leave it 404.
- Random or malformed URLs — leave them. Bots probe for wp-login and similar constantly; that is what 404 is for.
- Deliberately deleted content — return 410 rather than 404 to state intent.
Finding them in practice
- 1Open Search Console, Pages, and read the "Not found (404)" group — then use the referring-page data to see where the links came from.
- 2Crawl the site and export every internal link resolving to 404; these are yours to fix at the source.
- 3Grep server logs for 404 responses and rank by frequency — the top of that list is where the real traffic loss is.
- 4Check analytics for pageviews on your 404 template, with the requested path recorded as a dimension.
- 5Compare against your sitemap: any URL listed there returning 404 is a contradiction to fix immediately.
# Most-requested missing URLs
awk '$9 == 404 {print $7}' access.log \
| sort | uniq -c | sort -rn | head -50
# 404s that Googlebot received — these matter most
grep Googlebot access.log \
| awk '$9 == 404 {print $7}' \
| sort | uniq -c | sort -rn | head -20
# Check a single URL's status
curl -sI https://example.com/some-path | head -n 1
Fixing the cause rather than the symptom
A redirect fixes one URL. Fixing the template that generated the broken link fixes every URL it will ever produce. When several 404s share a pattern — a category that was renamed, a trailing slash that was dropped — the pattern is the bug. Work through broken internal links for the link-level repair, and keep the redirect chain short as described in redirect chains .
How DomainLens contributes
DomainLens checks the links on the pages it audits and reports those that do not resolve, alongside the status code of the page itself — so broken internal links surface in the same pass as the rest of the audit. For the page visitors land on see custom 404 pages , and to trace where a URL ends up use the redirect checker .
- How many 404s are too many?
- There is no threshold. Google expects 404s and does not penalise them. What matters is whether the URLs returning 404 should exist — one broken link to an important page matters more than a thousand bot probes.
- Should I redirect all 404s?
- No. Redirect only where a genuine equivalent exists. Bulk redirects to unrelated pages become soft 404s and help nobody.
- Do 404s waste crawl budget?
- Marginally, and only at scale. On a large site with thousands of crawled 404s it is worth addressing; on a small site it is noise.
- How long should I keep a redirect for a deleted page?
- At least a year if the page had external links or traffic. After that, if nothing arrives, let it 404.