Recipe

The broken-link sweep

By Axel Antas-Bergkvist Published June 10, 2026
Time ~40 min for 300 posts
Cost ~$1.50 in tokens
Risk Low — internal fixes are checked against real slugs; you approve the rest

Links rot quietly. You rename a post and three older ones still point at the old slug. A source you cited goes offline. A product page moves. None of it throws an error you’d notice — the post still loads, the link just goes nowhere, and every reader who clicks it (and every crawler that follows it) hits a dead end. Over years an archive accumulates hundreds of these, and they do real damage: broken internal links waste the crawl budget and link equity you meant to pass along, and broken outbound links read as neglect. The reason nobody fixes them is that finding them means clicking every link on every page. This recipe does the cataloging for you, then repairs the internal ones automatically against your actual list of live URLs — so a “fix” can never point at another dead slug.

What you need

  • Spectersync synced to your blog
  • An AI assistant you already use
  • Your list of live slugs — Spectersync already knows these from the sync, which is what makes the internal fix safe

The recipe

  1. Pull and stage. Spectersync pull, git baseline. Every post is local Markdown, and the sync gives you the full set of valid internal slugs.
  2. Catalog the links (read-only). The auditor extracts every link, classifies it internal vs outbound, and for internal links checks the target against the live-slug list. It produces a report: which posts, which links, which are dead. No files change.
  3. Fix internal links automatically. For dead internal links where a current post clearly replaces the old one, the fixer rewrites the link to the live slug. Spectersync validates every rewritten internal link against the real slug list and strips any it can’t resolve — a guardrail against swapping one dead link for another.
  4. Flag outbound links for review. Dead outbound links can’t be auto-fixed (you have to decide: find an archive copy, swap the source, or drop the link). The report lists them with the anchor text and surrounding sentence so the call is quick.
  5. Dry-run and push. Preview the internal repairs as a diff, push them back, and work the outbound list by hand.

The prompt

The auditor is read-only:

Extract every hyperlink from each post. For each link record: source post, anchor
text, URL, and type (internal or outbound). For internal links, compare the
target against this list of live slugs: {LIVE_SLUGS}. Mark each internal link OK
or BROKEN (target not in the list), and for broken ones suggest the closest live
slug if an obvious replacement exists. List outbound links separately for manual
review — do not attempt to verify them. Output grouped by post, then a summary of
total broken internal vs outbound. Do NOT modify any files.

The internal-link fixer (Spectersync re-validates every result against live slugs):

For each BROKEN internal link with a confident replacement from the audit,
rewrite the link target to the suggested live slug and keep the anchor text
unchanged. Only act where the replacement is unambiguous; leave anything
uncertain for manual review. Do not touch outbound links. Log every rewrite as
old-URL → new-URL with the post it appeared in. Change nothing else.

Cost and time

Blog sizeTokens (audit + fix)CostWall-clock
100 posts~180k + ~60k$0.4012 min
300 posts~540k + ~180k$1.4040 min
800 posts~1.5M + ~500k$41.5 hr

Most of the wall-clock is working the outbound list, which is genuinely manual — the internal repairs are fast and safe.

Pitfalls

  • Outbound links need a human. A dead source might have moved, not vanished; the right fix is often a new URL, not deletion. Don’t let the model guess these.
  • Anchored fragments. A link to /post#section can break if the heading was renamed even when the page is live — the audit flags the page as OK; spot-check fragments on important pages.
  • Trust the slug guardrail, but verify once. Spectersync strips internal links it can’t resolve; confirm a couple of rewrites landed on the intended post before a bulk push.

Where to go next

It pairs naturally with the internal link engine — once the broken links are gone, add the good links you’re missing between related posts.