Rankelle

How to find and fix broken internal links

A broken link is two problems: the page that is gone, and every page that still points at it. Fix it at both ends.

Internal links break when pages move or are deleted and nothing updates the pages that referenced them. Each one is a dead end for a crawler and a dead end for a reader, and the broken-internal-link finding is one of the most common things a first crawl of any site older than a year reports.

The method is to think in targets rather than in links. One deleted page referenced from forty places is one fix — redirect or restore the target — not forty edits. The edits are still worth doing afterwards, but the redirect stops the bleeding today.

The steps

  1. Crawl and export every link with its statusSource page, link target, response code. Filter to internal targets returning 404, 410, or 5xx. Keep redirect chains in a second list; they are not broken yet, but they are how links break slowly.
  2. Group by targetCount the sources per target. The list is now 'this missing page is linked from 40 places', which is a list of pages, not a list of links, and it is much shorter.
  3. Rank the targets by what they used to earnSearch Console keeps impressions for a URL for months after it stopped responding. A missing page that had traffic is a redirect worth writing today; a missing page that never had any can be removed from the sources at leisure.
  4. Restore, redirect or remove — per targetIf the page should exist, restore it. If a replacement exists, 301 to it and nowhere else — not to the home page, which Google treats as a soft 404. If neither, return 410 and remove the links. Then update the source pages so the redirect stops being needed.
  5. Re-crawl and confirm the count is zeroA crawl a week later that reports the same targets means the redirect rule did not deploy, or matches a different URL form than the one linked. Checking that a fix actually landed is the step most people skip, and it is why the same links show up in the next audit.

Redirect chains are the slow version

A link to a page that redirects to a page that redirects again is still a working link, until one hop in the middle is removed. Chains also cost crawl budget on every visit. Fix them by pointing the source at the final destination directly, which is the same edit you make for a broken link, made earlier.

A redirect loop is a chain that never arrives, and it is reported separately because it takes the page down entirely.

Questions people ask

Should every 404 be redirected somewhere?

No. A redirect to an unrelated page — most often the home page — is treated as a soft 404 and gains nothing. Redirect where a genuine replacement exists; otherwise return 404 or 410 honestly and remove the links pointing at it. A clean 410 is a better signal than a misleading 301.

How do I stop new broken links appearing?

You cannot entirely, because content keeps moving. What you can do is find them within days rather than at the next annual audit. A scheduled crawl reports each new one as it appears, which is the watching half of what Rankelle does between the fixes.

Try it on your own site, free

The whole audit of every website you add, no card and no expiry. Pay only when you want the proof.