Fix internal links to 404 pages

Internal links to 404 pages waste crawl budget and strand visitors. Crawl the site, list every target that returns 404 or 410, and trace the linking pages. Then either update the link to a live URL or add a redirect when a real replacement exists. Re-crawl to confirm zero broken internal links.

highIn codeimpact effort

Why this matters

Every broken internal link is a dead end you control.

Get the full breakdown

The extended brief explains when this works, when it does not, and the trade-offs. Join the waitlist and it unlocks for every tip when sign-in opens; MCP access is the paid part.

Join the waitlist

Before you start

  • A crawler that reports response codes
  • Access to templates and CMS content

How to apply it

  1. Crawl and group broken targets General best practice

    Run a crawl that reports internal links with 4xx targets. Sort by the number of linking pages and by the traffic the source pages receive.

    Check: The crawl export lists each 4xx target URL with its count of internal referrers.

  2. Update links at the source General best practice

    Change hrefs in templates, navigation and CMS fields to the correct live URL. Use a redirect only when the original content moved and the new URL is clearly equivalent.

    Check: The source template no longer contains the broken path, confirmed by grep in the repository.

  3. Re-crawl and automate the check General best practice

    Re-run the crawl after deploying and add a broken-link step to CI. Keep a baseline so new 4xx links fail the check.

    Check: The post-deploy crawl reports zero internal links to 4xx URLs.

Get the prompt for your agent

A ready-to-paste prompt for your agent that implements this tip and verifies the result in your repo.

Join the waitlist

Source: seo-mcp playbook · curated entry · report an error

Framework notes

nextjs-app

Replace `<Link href="...">` values that point at removed routes, and rely on typed route helpers so a deleted page fails the build.

wordpress

Search the post content and menus for old permalinks; use `wp-cli search-replace` for bulk updates and check menu items separately.

Official references

Let your agent apply this + 161 more tips.

Pre-order — $19