Learn

Broken links and 404s: how to find and fix them

A broken link is a dead end for a visitor and for a crawler. Some 404s are a real problem and many are normal. This guide shows how to find them, how to tell the two apart, and what the right fix is for each.

Updated · For agents: Markdown · skill

A link is broken when the address it points to answers with an error, most often 404, “not found”. The page was deleted, its address changed, or the link was mistyped.

For a visitor it is a dead end at the moment they wanted something. On a product or a pricing link, that is a lost sale. For a crawler it is a page it cannot reach, and whatever value links to that address carried goes nowhere.

It helps to know what it does not cost. Google treats 404s as a normal part of the web. Pages get removed, and a 404 for a page that is truly gone is the correct answer. A list of 404s in Search Console does not lower the ranking of your other pages. So the goal is not zero 404s. It is no broken links on your own site, and no lost page that still matters.

They have different causes and different fixes:

  1. Links on your site to your own pages. Fully in your control, and the ones visitors hit most. Fix all of them.
  2. Links on your site to other sites. The other site changed. Replace the link or remove it.
  3. Links on other sites to yours. You cannot edit them, but you can redirect the address they point to.

Images, scripts and stylesheets break the same way. A missing image shows as an empty box. A missing script can stop a menu or a form from working, which is much worse than it looks in a report.

Find them

Choose the right fix

For each broken address, ask what happened to the page:

What happened Fix
The link has a typo or an old address Correct the link
The page was deleted by mistake Restore it at the same address
The page moved Permanent redirect (301) from the old address to the new one
The page is gone and something equivalent exists Redirect to the equivalent page
The page is gone and nothing replaces it Leave it as 404, and remove links to it

Two rules keep this clean:

Make “not found” say so

A missing page must answer with status 404. Some sites show a “page not found” message with status 200, or send every unknown address to the home page. Crawlers then treat thousands of junk addresses as real pages, and your own link checks stop finding anything.

Test it: request an address that cannot exist and look at the status code.

Then make the page itself useful. Keep the header and navigation, say plainly that the page was not found, and offer a search box or links to the main sections. It will not help rankings. It keeps a visitor who would otherwise leave.

Prevent the next ones

A free WitnessQA audit follows the links on your pages and reports each broken link with the page it is on.

Watch

The checklist

Every step says what to do and how to verify it from outside. The tags are the WitnessQA checks that verify it for you in a free audit. Agents can load the same list as a skill file.

  1. Crawl the links on your own pages

    Follow every link on every page of the site. No link to one of your own pages may lead to a page that does not exist.

    Verify: Request each same-site link. Every one answers below 400. For each that does not, note the page the link is on and its link text.

  2. Check the links that leave your site

    Links to other sites still lead to a working page. Replace or remove the ones that do not.

    Verify: Request each external link. Treat 404, 410 and 5xx as broken. 401, 403 and 429 usually mean the other site refuses automated requests, not that the link is dead.

  3. Check images, scripts and stylesheets

    Every file a page loads exists. A missing image shows as a broken icon and a missing script can stop the page working.

    Verify: Load each key page in a browser and list the requests. None of the page's own files answers 404.

  4. Make missing pages answer 404

    An address that does not exist answers with status 404, not with 200 and a "not found" message, and not with a redirect to the home page.

    Verify: Request an address that cannot exist, such as /this-page-does-not-exist-123. The status is 404 or 410.

  5. Redirect pages that moved

    When a page gets a new address, the old one redirects to it with a permanent redirect, straight to the final URL.

    Verify: Request each old address you know of. It answers 301 or 308 to a page that answers 200, in one step.

  6. Keep the sitemap clean

    The sitemap lists only pages that exist, by their final address.

    Verify: Request every URL in /sitemap.xml. Each answers 200 without a redirect.

  7. Give the 404 page a way forward

    The "not found" page keeps the site navigation and offers a search or links to the main sections.

    Verify: Open the 404 page. It has the site header and at least one link to a working page.

  8. Read what the search engines report

    Look at the "Not found (404)" list in Google Search Console and fix the addresses that are important or that other sites link to.

    Verify: Ask the site owner. This cannot be checked from outside.

See which of these your site passes, with evidence for each.

Run a free audit