Sub topic 14
Reclaiming links to your own broken or moved pages
This chapter assumes you can read a backlink export (CSV) and know what 200, 301 and 404 mean. It covers the third link source in this tutorial: links other sites already give you that point to a URL on your site that no longer works.
Why this is the cheapest link to win
Broken link building asks a stranger to edit their page. Here, the editor already chose to link to you. If the target URL returns a 404, that link passes little or no value. Fixing your own side usually takes minutes and needs no outreach.
Links break on your side for common reasons:
- A page was deleted during a redesign.
- A URL changed (slug edit, new folder, HTTP to HTTPS, new domain) without a redirect.
- A linking site made a typo, such as
/pricnginstead of/pricing.
Find the affected URLs
Export the pages that receive backlinks from your SEO tool, then check each target's current response. Do not follow redirects automatically, because the first hop is what you want to see.
import csv
import requests
HEADERS = {"User-Agent": "link-audit/1.0"}
def check(url):
try:
resp = requests.head(url, headers=HEADERS, allow_redirects=False, timeout=10)
return resp.status_code, resp.headers.get("Location", "")
except requests.RequestException:
return None, ""
with open("backlink_targets.csv", newline="", encoding="utf-8") as f:
for row in csv.DictReader(f):
url = row["target_url"]
status, location = check(url)
if status is None or status in (404, 410) or status >= 500:
print("FIX", status, url)
elif status in (301, 302, 307, 308):
print("REDIRECT", status, url, "->", location)The CSV needs a target_url column. Sort the FIX rows by the number of referring domains, so you repair the most valuable URLs first.
Choose the fix
| Situation | Fix |
|---|---|
| Page moved | Add a one-to-one 301 redirect to the new URL |
| Page deleted, a close equivalent exists | 301 redirect to that equivalent |
| Page deleted, no equivalent, strong links | Restore it or publish a new page at the same URL |
| Typo in the linking site's URL | Redirect the typo URL, or email the editor with the correct one |
Common errors
- Redirecting everything to the homepage. Search engines can treat a redirect to an unrelated page as a soft 404, so the link value is lost. Redirect to the closest topical match.
- Redirect chains. Old URL to a middle URL to the final URL wastes crawl effort. Point each old URL directly at the final one.
- Using 302 for a permanent move. Use 301 or 308 when the move is permanent.
- Fixing once and forgetting. Recheck monthly, because new links to broken URLs keep appearing.
If a redirect is impossible, email the linking site with the old URL, the working URL and a short thank-you. Keep it as brief as the broken link template from earlier chapters.
Exercise
A backlinked URL, /blog/old-seo-guide, returns 404. The site has a newer /blog/seo-guide covering the same topic. What should you do, and why not redirect to the homepage?
Show answer
Add a 301 redirect from /blog/old-seo-guide directly to /blog/seo-guide. It is the closest topical match, so the link's relevance and value carry over. A homepage redirect may be treated as a soft 404, and visitors who expected the guide would be confused.