Sub topic 7
What Broken Links and Redirects Cost You
This chapter assumes you can read HTTP status codes and tell 301 from 302. It also assumes you know what a redirect chain is. If not, review the earlier chapters on status codes and redirect types. Here you will see where each problem costs you, so you can decide later which ones to fix first.
Three places the cost lands
A broken link or slow redirect path affects three groups.
- Users. They hit an error page, wait on extra round trips, or leave.
- Crawlers. They spend requests on URLs that return nothing useful, and they may give up on long redirect paths.
- Search visibility. Pages can drop out of the index. Ranking signals from inbound links can fail to reach the page that should receive them.
Cost to users
A 404 on an internal link is a dead end. The visitor came for specific content and did not get it. Some will use your navigation or search, and many will leave. The cost grows with the page's role. A 404 on a checkout or download link loses a sale or a signup. A 404 on an old blog post loses little.
Redirects cost time. Each hop is a full request and response. A hop to a different host can also need a new DNS lookup, TCP connection, and TLS handshake. On a slow mobile connection, a chain of three or four hops can add seconds before the browser receives any HTML. You can measure this directly:
curl -s -o /dev/null -L -w 'hops=%{num_redirects} redirect_time=%{time_redirect}s total=%{time_total}s\n' https://example.com/old-pagetime_redirect is the time spent on all redirect steps before the final request. Compare it with total. If redirects take a large share of the total, collapsing the chain is worth doing.
A redirect loop is worse. Browsers stop after a fixed number of hops and show an error such as ERR_TOO_MANY_REDIRECTS. The page is unreachable until you fix the server rule.
Cost to crawlers
Search engine crawlers request URLs with a limited budget. Each request that returns a 404, a redirect, or a soft 404 is a request that did not fetch a real page.
- 404 and 410. The crawler records that the URL is gone. It may retry for a while, then request it less often. A few hundred dead URLs on a small site cost almost nothing.
- Redirect chains. Googlebot follows a limited number of hops, up to 10 according to Google's documentation. Beyond that it stops and Search Console reports a redirect error. Even short chains cost extra requests per URL, and the crawler may postpone following the later hops.
- Redirect loops. The crawler never reaches content. The URL is reported as an error and is not indexed.
- Soft 404s. The server returns 200 for a page that says "not found". Google tries to detect these and treats them like 404s. Until it does, the page may sit in the index or waste crawl requests. Search Console lists them under a soft 404 status.
- 5xx errors. Repeated server errors make Google slow its crawl rate. If a URL keeps failing for a long time, it can be dropped from the index.
Crawl budget is mainly a concern for large sites, such as hundreds of thousands of URLs, or sites that change often. On a small site with a few hundred pages, crawl waste is rarely the limiting factor. The user cost and the lost link signals are more likely to matter.
Cost to search visibility
Other sites link to your pages. Those links are a ranking signal. If the target URL returns 404, the signal has nowhere to go. If the target redirects with a 301 or 308 to a relevant replacement, Google generally transfers the signals to the new URL. Google has said that 301 redirects do not lose PageRank by themselves.
That makes redirects a fix, not a penalty. The risks come from how redirects are used:
- Irrelevant targets. Redirecting many unrelated old pages to the home page is often treated as a soft 404. The signals are not passed on, and the user does not find what they wanted.
- Temporary redirects left in place. A 302 or 307 tells crawlers the move is temporary. Google may keep the old URL indexed. If the move is permanent, use 301 or 308.
- Chains that grow over time. Each redesign adds a hop on top of the previous one. Nobody removes the older rules, so
/agoes to/bgoes to/cgoes to/d. - Noindex or blocked targets. A redirect to a page that is itself blocked or errors out gives the signals nowhere useful to land.
Be accurate about what 404s do. Google states that 404 errors on URLs that should not exist do not harm the rest of your site's ranking. A 404 for a page that was deleted on purpose is correct behavior. The harm is specific: a 404 on a page that still has traffic, inbound links, or internal links pointing to it.
Cost summary by problem type
| Problem | User impact | Crawler impact | Signal impact |
|---|---|---|---|
| Internal link to a 404 | Dead end | Wasted request on each crawl | Link passes nothing |
| External link to a 404 | Dead end | Wasted request when found | Lost inbound signal |
| Redirect chain | Slower load | Extra requests, possible give-up | Usually passed, but at risk |
| Redirect loop | Browser error | Not indexed | None |
| Soft 404 | Confusing page | Treated as 404, wasted requests | None |
| Persistent 5xx | Page unavailable | Crawl rate reduced, URLs dropped | Lost if dropped |
Turning the cost into a number
You can estimate waste from your access log. This command counts 404 requests by path and referrer in the combined log format, where field 7 is the path, field 9 is the status, and field 11 is the quoted referrer:
awk '$9 == 404 {print $7, $11}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head -20An internal referrer on your own domain means you have a link to fix. An external referrer means a redirect may be worth adding. A path with no referrer, hit repeatedly, is often a bot or a bookmark.
The following script ranks problem URLs by a simple score. The weights are arbitrary, so adjust them to your site. It runs as shown with Python 3.
problems = [
{"url": "/pricing-old", "status": 404, "visits": 420, "backlinks": 18, "internal_links": 0},
{"url": "/blog/2019/tips", "status": 404, "visits": 12, "backlinks": 1, "internal_links": 35},
{"url": "/docs/v1/start", "status": 301, "visits": 90, "backlinks": 6, "internal_links": 12, "hops": 3},
]
def score(p):
s = p["visits"] + 25 * p["backlinks"] + 5 * p["internal_links"]
if p["status"] == 404:
s *= 1.5
s += 20 * max(p.get("hops", 1) - 1, 0)
return s
for p in sorted(problems, key=score, reverse=True):
print(f"{score(p):8.1f} {p['status']} {p['url']}")The point is the ordering. Traffic, inbound links, and internal links all raise a URL's priority, and a later chapter covers how to use that ordering.
Common mistakes when estimating cost
- Treating every 404 as an emergency. Deleted pages should return 404 or 410. Count only the ones that still receive traffic or links.
- Ignoring chains because the final page loads. The page works, but each user and crawler pays for the extra hops.
- Assuming a redirect is free. It preserves signals but adds latency and a request. Updating the source link is cheaper.
- Trusting a 200 status. Soft 404s return 200. Check the page content as well as the code.
Exercise
An old URL with 200 monthly visits and 15 external backlinks currently returns a 404. A relevant replacement page exists. Your log also shows a 4-hop chain on a URL that gets 3 visits a month and has no backlinks. Which do you fix first, and how?
Show answer
Fix the 404 first. Add a one-hop 301 (or 308) from the old URL to the relevant replacement page. It has real traffic and backlink signals that are currently lost. The 4-hop chain has little traffic and no backlinks, so it is low priority. Collapse it into a single hop when you next touch the redirect rules.
Exercise
Why does a redirect chain cost users time even when the final page returns 200?
Show answer
Each hop is a separate request and response. Cross-host hops may also need a new DNS lookup, TCP connection, and TLS handshake. The browser cannot start loading the final page until every hop completes, so the delay adds up before any content arrives.