Sub topic 4
Broken Link Building from Start to Finish
This chapter walks through the full broken link building workflow, from choosing targets to confirming a placed link. It assumes you know what a backlink and anchor text are, can read HTML anchor tags, and recognize status codes such as 200, 301 and 404. Later chapters go deeper on several steps. Here you will see how they fit together.
What the tactic is
Broken link building means finding a link on someone else's page that points to a dead resource, then suggesting your own relevant page as the replacement. The site owner fixes a real defect on their page. You earn an editorially placed link. Both sides get something, which is why replies are more common than with generic link requests.
The tactic only works when your replacement is a true fit for what the dead link used to cover. A loosely related page reads as a pitch, not a fix.
The workflow at a glance
Stage 1: Find pages worth auditing
Start with pages likely to hold many outbound links in your topic. Resource pages, "best of" lists, link roundups and long guides are the usual candidates. A search query such as the following surfaces resource pages for a topic:
intitle:resources "web analytics" inurl:linksPrefer pages that are relevant to your subject, hosted on a site with real editorial standards, and still maintained. A page last edited eight years ago may have a dead link, but nobody may be around to fix it.
Stage 2: Detect broken links
A link is broken when the destination no longer delivers the content the author meant to cite. The clear cases are connection failures, 404 (not found) and 410 (gone), plus 5xx server errors that persist. Redirects need judgment. A 301 to a relevant new URL is healthy. A 301 to a home page often hides a removed page, and some servers return 200 for a "not found" page (a soft 404). The status codes chapter covers these cases.
The script below fetches a page, resolves every outbound link, and reports the failures. It falls back to GET because some servers reject HEAD requests.
import requests
from urllib.parse import urljoin, urlparse
from bs4 import BeautifulSoup
HEADERS = {"User-Agent": "link-audit/1.0"}
def find_broken_links(page_url, timeout=10):
html = requests.get(page_url, headers=HEADERS, timeout=timeout).text
soup = BeautifulSoup(html, "html.parser")
broken = []
seen = set()
for a in soup.find_all("a", href=True):
url = urljoin(page_url, a["href"])
if urlparse(url).scheme not in ("http", "https") or url in seen:
continue
seen.add(url)
try:
resp = requests.head(url, headers=HEADERS, allow_redirects=True, timeout=timeout)
if resp.status_code in (403, 405, 501):
resp = requests.get(url, headers=HEADERS, stream=True, timeout=timeout)
resp.close()
status = resp.status_code
except requests.RequestException:
status = None
if status is None or status in (404, 410) or status >= 500:
broken.append((url, status))
return broken
if __name__ == "__main__":
for url, status in find_broken_links("https://example.com/resources"):
print(status, url)A few details in this script matter:
urljointurns relative links such as/guideinto full URLs.- The
seenset avoids checking the same URL twice. - A status of
Nonemeans the request failed to connect, which usually means the domain no longer exists. allow_redirects=Truemeans the status you see is the final one after redirects.
Treat the output as a list of candidates. A single failure can be a temporary outage, so recheck each one on a different day before you write to anyone.
Stage 3: Recover what the dead page said
Before you write anything, find out what the dead page covered. The Internet Archive's Wayback Machine often has a copy. Look at the title, headings and main points, and note the context in which the page linked to it. Your replacement is judged against that original content, so you need to know what it offered. A later chapter covers archives in more detail.
Stage 4: Choose or create the replacement
Check whether you already have a page that covers the same ground. A good replacement matches the topic, serves the same reader need, and is at least as useful and current as the original was. Three outcomes are possible:
| Situation | Action |
|---|---|
| An existing page of yours matches closely | Use it |
| A page partly matches | Improve it first, then use it |
| Nothing matches | Write a new resource, or skip the prospect |
Do not stretch a weak match. If the dead link was about event tracking and your page is a general analytics product page, the site owner will see the mismatch at once, and your credibility drops for later requests.
Creating content for one broken link is rarely worth it. It makes sense when the same dead resource is linked from many pages, because one new page then serves many prospects. A backlink checker run on the dead URL shows who else linked to it.
Stage 5: Qualify and send outreach
Not every page with a broken link is worth a message. Judge each prospect on relevance to your topic, the authority and quality of the site, and where your link would sit. A link inside the body text of a maintained page is worth more than one in a footer or a long list of unrelated links.
The message should be short and specific. It names the page, identifies the exact broken link, offers one replacement, and leaves the decision to the owner. Here is a template:
Subject: Quick fix for a dead link on your resources page
Hi Sam,
While reading your page on web analytics basics, I noticed the link to "Guide to Event Tracking" returns a 404 error.
We published a guide on the same topic that covers the same ground and is kept up to date: https://example.com/event-tracking-guide
If it fits, it could replace the broken link. Either way, I thought you would want to know about the error.
Thanks,
AlexNotice what the message leaves out. It does not demand a link, flatter the owner, or specify anchor text. Send one polite follow-up after about a week if you get no reply, and then stop.
Stage 6: Track the outcome
Log every prospect in a sheet with these columns: page URL, broken URL, status code seen, replacement offered, contact, date sent, follow-up date, reply, and link placed (yes or no). Then recheck the page a few weeks after a positive reply to confirm the link is live. Success rate is links placed divided by messages sent. Broken link campaigns commonly land in the low single digits to low double digits as a percentage, so judge your own result against your own earlier campaigns.
Common errors
- Reporting false positives. A site that blocks bots can return 403 to your script while working fine in a browser. Open the link by hand before you claim it is dead.
- Ignoring redirects. A link that redirects to an unrelated page is broken in practice, even though the final status is 200.
- Pitching a poor match. This is the most common reason for no reply.
- Skipping the archive step. Without it you cannot tell whether your page truly replaces the dead one.
- Over-automating. Scripts find candidates. A person should judge fit and write each message.
- Over-optimized anchors. Let the owner choose the anchor text. Requesting an exact-match keyword anchor is a risk signal.
Limits
The tactic scales poorly by nature. Each win needs a relevant page with a real broken link, and you need a real replacement. Treat it as one source of links alongside others, not a full link strategy.
Exercise
A resource page links to a URL that returns a 301 redirect to the other site's home page. Your script reports status 200 because it followed redirects. Is this link a broken link building prospect, and what should you check before contacting the owner?
Show answer
It can be a prospect. Redirecting an old page to a home page often means the original content was removed, so the link is effectively dead even though the final status is 200. Before contacting the owner, open the original URL in a browser to confirm it no longer shows the content the link promised, check the Wayback Machine to see what the page used to say, and confirm you have a close replacement. If the page still has the content under a new URL, the link is fine and there is no prospect.
Exercise
Name the six stages of the workflow in order, and say which stage decides whether a prospect is dropped when you have no matching content.
Show answer
Find relevant pages, detect broken links, recover what the dead page covered, choose or create a replacement, qualify and send outreach, then track the outcome. The replacement stage (stage 4) is the decision point: with no close match and no good reason to create new content, you skip the prospect.