Prompt
I'm building a page generator and need internal linking at scale
Latest observation
Absolutely — internal linking at scale is a great fit for a page generator, but it works best if you treat it like a link graph problem, not a manual SEO task.
Core goal
You want your generator to automatically create:
- relevant links
- consistent anchor text
- good crawl paths
- balanced link equity
- no over-optimization / spammy patterns
A scalable internal linking strategy
1) Build a content graph
Represent your pages as nodes and relationships as edges.
Typical metadata per page:
urltopicprimary keywordsecondary keywordscontent typehub / clusterprioritypublished datetraffic / conversionsrelated entities
Then define linking rules based on:
- same topic cluster
- parent/child relationship
- complementary intent
- shared entities
- user journey stage
2) Use hub-and-spoke architecture
A reliable large-scale pattern:
- Hub pages: broad, high-level pages
- Spoke pages: specific subtopics
- Cross-links between closely related spokes when useful
Example:
/seo/→ hub/seo/internal-linking//seo/canonicalization//seo/crawl-budget/
Then:
- spokes link back to hub
- hub links to spokes
- related spokes link to each other sparingly
This helps both users and crawlers.
3) Generate links by relevance score
For each page, score candidate links based on factors like:
- topical similarity
- semantic overlap
- entity overlap
- intent match
- same funnel stage
- conversion relevance
- recency/freshness
- importance of target page
- existing link count to target page
A simple scoring formula might look like:
score =
topical_similarity * 0.35 +
entity_overlap * 0.20 +
intent_match * 0.15 +
conversion_priority * 0.10 +
freshness * 0.05 +
target_priority * 0.15
Then link to the top N candidates, while enforcing caps.
4) Control link density
At scale, too many links become noise.
Good safeguards:
- cap internal links per page section
- cap total internal links per page
- avoid linking the same target repeatedly on one page
- vary anchor text naturally
- prevent footer/sidebar from becoming a junkyard of links
A useful pattern:
- 3–8 contextual links in body content
- optional related links module
- breadcrumbs
- nav / footer only for global structure
5) Use templates with dynamic link insertion
If you’re generating pages, your templates can include slots like:
- “Related guides”
- “Recommended next steps”
- “Learn more about X”
- “Common issues”
- “Popular in this category”
The generator can fill these slots from the content graph.
This is more maintainable than hardcoding links into content.
Practical architecture
Data layer
Store pages in a database with fields like:
{
"id": "page_123",
"slug": "/seo/internal-linking/",
"title": "Internal Linking Guide",
"topic": "seo",
"cluster": "technical-seo",
"primary_keyword": "internal linking",
"entities": ["crawl budget", "anchor text", "page authority"],
"priority": 0.9
}
Link generation pipeline
- Extract topic/entities from content
- Generate candidate targets
- Score candidates
- Apply rules/filters
- Insert links into template/content
- Store rendered links in output
- Rebuild periodically as content changes
Rules that matter for SEO
Keep these in mind:
- Link from important pages to important pages
- Make sure every important page has at least some internal links pointing to it
- Don’t orphan pages
- Use descriptive anchors, but not the same exact phrase everywhere
- Don’t force links into irrelevant sentences
- Ensure crawl paths from homepage → hub → spoke are short
- Update links when pages are renamed or deprecated
Common pitfalls
Avoid:
- auto-linking every keyword occurrence
- linking irrelevant pages just to add links
- creating infinite cross-link loops
- using generic anchors like “click here”
- too many exact-match anchors
- forgetting canonical/deprecated pages
- having pages with zero inbound internal links
Good defaults for automation
If you want a simple starting setup:
- Every page links to:
- its parent hub
- 2–5 related pages
- 1 next-step/conversion page if relevant
- Every hub links to:
- all core spokes
- Every spoke links back to:
- the hub
- 1–3 sister pages
- Limit contextual links to relevant placement only
If you want the system to be strong
Add these features:
- semantic search for related pages
- link auditing dashboard
- orphan page detection
- broken link detection
- link equity simulation
- per-template link rules
- A/B testing for internal link placement
Suggested implementation approach
If you’re building this in software, I’d recommend:
- Create a page index
- Build a topic/entity extraction job
- Use a scoring engine for candidate links
- Enforce per-page and per-target limits
- Generate links during rendering
- Recompute links on content changes
- Track click performance to refine rules
If you want, I can help you with one of these next:
- a database schema for internal linking
- a link scoring algorithm
- a code example in Python/TypeScript
- a prompt/system design for AI-generated internal links