How to fix 404 Not Found errors and broken links
Short answer: a 404 means the address doesn't match any page. Find the broken links with Google Search Console or a link checker. Then fix the link, restore the page, or add a 301 redirect to the closest matching page. Leave real dead ends as 404s, and give them a helpful 404 page.
Why 404 errors happen
- A page was deleted, renamed or moved, and the old address wasn't redirected.
- A link has a typo, for example
/contcatinstead of/contact. - The site moved from
httptohttps, or to a new domain, without redirects. - A file was uploaded with different capital letters. On Linux servers,
Photo.jpgandphoto.jpgare different files. - Someone else's site links to an address that never existed.
How to find them
- Google Search Console → Pages → Not found (404). Shows addresses Google tried and failed to load.
- A crawler or link checker. It follows every link on your site and lists the broken ones.
- Your server logs or analytics. Look for the most visited 404 addresses, and fix those first.
Fix, redirect or leave it?
| Situation | What to do |
|---|---|
| Your own link has a typo | Fix the link |
| The page moved | Add a 301 redirect from the old address to the new one |
| The page was removed and a close replacement exists | 301 redirect to the replacement |
| The page was removed and nothing is similar | Leave it as 404 (or 410 Gone) |
| Random addresses from bots | Ignore them |
Don't send every missing page to the home page. Search engines treat that as a "soft 404", and visitors find it confusing.
How to add a 301 redirect
On Apache or LiteSpeed hosting, add a line to .htaccess:
Redirect 301 /old-page /new-pageIn WordPress, a redirect plugin does the same without editing files. On Nginx:
location = /old-page { return 301 /new-page; }On Next.js and similar frameworks, use the redirects setting in the framework's config, or your host's redirect rules.
Test the redirect in a private window. Keep the chain short: old → new, never old → older → new.
Make a helpful 404 page
A good 404 page:
- says clearly that the page wasn't found,
- has a search box or links to your main sections,
- keeps your normal header and footer,
- returns a real 404 status code, not 200.
Prevent new 404s
- Redirect the old address whenever you rename a page.
- Use consistent lowercase file names.
- Check links before launch. Our website launch checklist covers it.
- Use short links you control for printed material, so you can update where they point. See the link shortener.
Questions
Do 404 errors hurt my rankings?
404s on pages that never mattered don't hurt your site as a whole. What you lose is the traffic and links that pointed at a page that used to work. Redirect those.
What's the difference between 404 and 410?
404 means "not found". 410 means "gone for good". Both remove the page from search results over time. 410 is a slightly stronger signal.
Why does my page work for me but show 404 for others?
Usually caching, a typo in a shared link, or capital letters in the address. Open the exact link in a private window to check.