All articles
SEO & GrowthNovember 25, 2026 6 min read

Internal Linking at Scale: The Graph-Based Approach That Fixed Our Orphan Page Problem

Manual internal linking dies at 500 pages. Here's how we modeled our site as a graph, found orphans and dead-end clusters, and automated link injection without turning the footer into a link farm.

Internal linking is the cheapest ranking lever you own, and the one most programmatic sites quietly waste. Once you cross a few hundred pages, hand-authored links stop scaling, template links start looking spammy, and your best content ends up with two inbound links from the sitemap and nothing else. We hit that wall on a client's 12k-page catalog last year. This is how we rebuilt it as a graph problem.

Why Manual Linking Dies at Scale

The pattern is familiar. You launch a programmatic section — city pages, comparison pages, glossary entries — and seed it with a few hand-picked links from your money pages. Rankings move. You ship more pages. The new ones inherit the same three template links in the sidebar, and now 80% of your pages share identical anchor text to the same three URLs.

Google sees that pattern immediately. Worse, from a link-equity standpoint, you've built a star topology: a handful of hubs hoarding PageRank, with a long tail of leaves that pass nothing back to anything useful. Googlebot crawls them once, sees no onward signal, and deprioritizes them.

The fix isn't more templates. It's modeling the site as what it actually is — a directed graph — and running real algorithms against it.

Model the Site as a Graph First

Before writing any linking logic, we build a snapshot of the current link graph. Nodes are URLs. Edges are in-body internal links (we exclude nav, footer, and breadcrumbs because they tell you nothing about topical relevance).

We pull the data from three sources and reconcile:

  • Rendered HTML crawl — the ground truth of what's actually linked
  • CMS/content database — the intended links, so we can spot rendering bugs
  • GSC internal links report — Google's view, which sometimes lags but reveals what gets counted
import networkx as nx

G = nx.DiGraph()
for page in crawl_results:
    G.add_node(page.url, cluster=page.topic_cluster, 
               depth=page.click_depth, impressions=page.gsc_impressions)
    for link in page.body_links:
        if link.is_internal and not link.is_nav:
            G.add_edge(page.url, link.target, anchor=link.anchor_text)

Once it's a graph, the diagnostic questions become trivial queries.

The Four Queries That Actually Matter

  1. Orphans: nodes with in_degree == 0 (excluding the homepage). These pages exist but nothing links to them.
  2. Dead ends: nodes with out_degree == 0. They receive equity and pass none forward.
  3. Weakly connected components: clusters that don't link to the rest of the site. Usually a sign that a programmatic section got shipped without integration links.
  4. PageRank distribution: run nx.pagerank(G) and plot the histogram. If the top 1% of pages hold 60%+ of the internal PageRank, your linking is top-heavy and your long tail is starving.

On the catalog we rebuilt, that first scan found 2,300 orphans, 4,100 dead ends, and three entire programmatic subtrees floating as disconnected components. All of it was invisible in the CMS.

Define What a Good Link Actually Looks Like

Automation without constraints produces link spam. Before injecting anything, we write the rules down.

A candidate link is valid if:

  • Source and target share a topical relationship (same cluster, or embedding similarity above a threshold we tune per section — usually around 0.75 cosine)
  • Anchor text is a natural phrase that already appears in the source body, or a close variant
  • The source page has fewer than N in-body internal links already (we cap around 100 for long articles, 25 for short ones)
  • The target isn't already linked from this page
  • The target has sufficient content quality (passes the same gate as indexable pages — no thin, no noindexed)

We also forbid reciprocal linking between any two pages. If A links to B, B cannot link back to A in the body. This stops the graph from collapsing into tight cycles that don't distribute equity outward.

Anchor Text Diversity as a Hard Constraint

The fastest way to get a programmatic linking system flagged is identical exact-match anchors at scale. We treat anchor diversity as a budget: for any target URL, no single anchor phrase can account for more than 30% of its inbound internal anchors. The link generator picks from a ranked list of candidate phrases extracted from source bodies, and skips the source if it can't find a phrase under budget.

This sounds fussy. It is the single rule that keeps the system looking editorial instead of templated.

The Injection Pipeline

With rules in place, the pipeline runs nightly:

1. Rebuild graph from latest crawl + CMS
2. Identify orphans, dead ends, weak clusters
3. For each underlinked target:
   - Find candidate source pages (topical match, not full)
   - Score candidates by: PageRank of source, 
     embedding similarity, anchor availability
   - Select top K sources respecting anchor budget
4. Emit link proposals as a diff (JSON)
5. Human review for proposals touching top-200 pages
6. Auto-merge the rest into CMS content blocks

The key design choice: links are stored as a separate layer in the CMS, not edited into source content. That means we can roll back a bad batch, A/B test linking strategies, and regenerate the graph without touching author copy.

We also rate-limit changes. No more than ~5% of pages get new in-body links in any 24-hour window. Dropping thousands of new links overnight looks exactly like what it is — automated — and it muddies attribution when you're trying to measure the lift.

Measuring Whether It Works

Two things to track, and they need different timeframes.

Crawl behavior (days to weeks). Pull server logs or the GSC Crawl Stats report. Pages that moved from orphan to well-linked should see Googlebot hit frequency rise within 1 – 3 weeks. If they don't, your links aren't being discovered — check that they're in rendered HTML, not injected after hydration in a way Googlebot ignores.

Ranking and impressions (4 – 12 weeks). Segment GSC data by the cohort of pages that received new inbound links. Compare impressions and average position against a holdout cohort that didn't. In our experience, well-targeted internal links on a healthy site move impressions on the receiving pages meaningfully within a quarter — but only if the receiving content is actually good. Internal links don't fix thin pages; they amplify whatever's there.

We also watch for negative signals: did any source pages lose rankings after we added outbound links? Rare, but worth catching early. A dashboard that diffs pre/post PageRank per page and overlays GSC position changes makes this a five-minute check.

What We Got Wrong the First Time

Two mistakes worth flagging.

First, we initially optimized for flattening the PageRank distribution — spreading equity as evenly as possible. That's wrong. You want equity concentrated on pages that can actually rank for valuable queries. The goal is to kill orphans and dead ends, not to turn every page into an equal citizen. We now weight target selection by commercial value and existing GSC impressions.

Second, we trusted embedding similarity too much early on. Two pages can be semantically close and still be a bad link pair — a glossary definition linking to a product page feels forced in body copy. We added an editorial check: does this link make sense if you read the sentence out loud? That heuristic now lives as a lightweight LLM pass over proposed anchor contexts before auto-merge.

Where We'd Start

If you're staring at a programmatic site and suspect your internal linking is the bottleneck, don't start with tooling. Start with a one-time graph audit: crawl, build the graph, run the four queries above, and look at the histogram. You'll know within an afternoon whether this is your problem.

If it is, build the pipeline incrementally — graph snapshot first, orphan detection second, manual link proposals third, automated injection last. Each step delivers value on its own, and you'll learn your site's quirks before you let anything write to production. If you'd rather not build it from scratch, this is the kind of engagement we scope under SEO engineering — the parts of SEO that look more like a data pipeline than a content calendar.

#SEO#Programmatic SEO#Graph Algorithms#Technical SEO

Want a team like ours?

72Technologies builds production software for the kind of teams who actually read this blog.

Start a project