Sub topic 10
Structuring a Site with Hubs and Shallow Click Depth
This chapter assumes you know how crawlers follow links from page to page, how URLs and slugs are built, and how to write a crawlable a element with descriptive anchor text. It builds on those to ask a structural question. Given hundreds of pages, which pages should link to which, and how far from the home page should each one sit?
Click depth
Click depth is the smallest number of link clicks needed to reach a page from the home page. The home page has depth 0. A page linked directly from the home page has depth 1. A page linked only from that page has depth 2.
Click depth matters for three reasons:
- Crawlers start from known URLs and follow links outward. Pages far from the start are found later and are often revisited less often.
- Links from the home page and other prominent pages tend to signal that a page matters. A page buried five clicks down signals the opposite.
- Visitors give up. A page that takes many clicks to reach is also hard for people to find.
Click depth is not the same as URL depth. The path /a/b/c/d/page/ has four folders, but if the home page links straight to it, its click depth is 1. Google has said that how close a page is to the home page in clicks matters more than how many slashes its URL has. A deep folder structure is not a problem in itself. A deep link structure is.
Many guides say to keep every page within three clicks of the home page. Treat that as a rough target, not a rule from any search engine. A site with 50 pages should be well under it. A site with a million product pages cannot meet it without help from hubs and category pagination, and that is acceptable if the important pages stay close.
Hubs and spokes
A hub is a page whose job is to link to a group of related pages. The linked pages are its spokes. A hub can be a category page, a topic guide, or a "start here" page. Each spoke links back to its hub and to a few sibling spokes.
This pattern gives you:
- Shallow reach. The home page links to a handful of hubs. Each hub links to its spokes. Most pages end up at depth 2.
- Topical grouping. Pages about one subject link to each other, which helps crawlers and readers see which pages belong together.
- Predictable paths. A reader on any spoke can go up to the hub and across to related pages.
The dotted arrows are the part people forget. A hub that links down without any spoke linking back is a one-way street. Links back to the hub and sideways to siblings, plus links from posts to the guides they relate to, are what turn a list of pages into a cluster.
What a good hub page contains
A hub should be more than a bare list of URLs. Give each link a short description, so that both the anchor text and the surrounding text say what the target covers.
<h1>Guides to URL slugs and internal links</h1>
<p>Start with slugs, then move on to how pages link to each other.</p>
<ul>
<li>
<a href="/guides/url-slugs/">Guide to writing URL slugs</a>:
length, characters, and how to change a slug safely.
</li>
<li>
<a href="/guides/internal-links/">Guide to internal links</a>:
where to place them and how many to use.
</li>
<li>
<a href="/guides/anchor-text/">Guide to anchor text</a>:
writing link text that describes the target.
</li>
</ul>The links are plain a elements with href values, so they are crawlable. The anchor text names each target. The sentence after each link adds context without padding.
Measuring click depth
Crawling tools report click depth, but the idea is simple enough to compute yourself. Click depth is the shortest path length in a directed graph, and a breadth-first search finds it. The script below takes a map from each page to the pages it links to. It reports each page's depth and any page the search never reaches.
from collections import deque
def click_depths(links, start="/"):
depths = {start: 0}
queue = deque([start])
while queue:
page = queue.popleft()
for target in links.get(page, []):
if target not in depths:
depths[target] = depths[page] + 1
queue.append(target)
return depths
site = {
"/": ["/guides/", "/blog/"],
"/guides/": ["/guides/url-slugs/", "/guides/internal-links/"],
"/guides/internal-links/": ["/guides/anchor-text/", "/guides/url-slugs/"],
"/guides/anchor-text/": ["/guides/anchor-text/examples/"],
"/guides/url-slugs/": [],
"/guides/anchor-text/examples/": [],
"/blog/": ["/blog/page-2/"],
"/blog/page-2/": ["/blog/page-3/"],
"/blog/page-3/": ["/blog/old-post/"],
"/blog/old-post/": [],
"/landing/seo-checklist/": ["/guides/"],
}
depths = click_depths(site)
all_pages = set(site) | {t for targets in site.values() for t in targets}
for page, depth in sorted(depths.items(), key=lambda item: (item[1], item[0])):
print(depth, page)
print("Orphans:", sorted(all_pages - set(depths)))Running it prints:
0 /
1 /blog/
1 /guides/
2 /blog/page-2/
2 /guides/internal-links/
2 /guides/url-slugs/
3 /blog/page-3/
3 /guides/anchor-text/
4 /blog/old-post/
4 /guides/anchor-text/examples/
Orphans: ['/landing/seo-checklist/']Two problems show up in this output:
/blog/old-post/sits at depth 4 because the only route to it is through paginated archive pages. Every new post pushes it one page further back./landing/seo-checklist/links out to/guides/, but nothing links to it. It has no depth at all. This is an orphan page.
The if target not in depths check matters. Without it, a cycle such as hub to spoke to hub would loop forever, and a page reached by a longer path could overwrite its shortest depth.
Designing the structure
Work from the top down:
- List your page types. For example: home, category hubs, guides, posts, product pages, utility pages.
- Choose the hubs. Each hub should cover one topic that readers actually look for, not just a folder name from your CMS.
- Link the home page to every hub. In the main navigation, in the body, or both.
- Link every spoke up to its hub. Breadcrumbs do this on every page, and they also show the page's position in the hierarchy.
- Add sibling and cross-hub links in the body. Put them where they help the reader, such as "next, read the guide to anchor text".
- Check the depth of what matters. Revenue pages, flagship guides, and anything you want ranked should be at depth 1 or 2.
Navigation, body links, and footers
Not all links carry the same weight in practice. A link in the main body of a page, with a sentence around it, tells a reader and a crawler something about the relationship. A link repeated in a sitewide footer on 10,000 pages tells them far less. Use navigation to expose hubs, and body links to express relationships between specific pages.
Common problems and edge cases
Pagination buries older content
An archive split into page-2, page-3, and so on makes the oldest items the deepest. Ways to keep them reachable:
- Link important older posts from a hub or a category page, not only from the archive.
- Add "related posts" links on newer pages that point to older ones.
- Show more items per page, so there are fewer pages to click through.
- Offer numbered links to later pages, not only "next".
Orphan pages
An orphan page has no internal links pointing to it. Crawlers can still find it through a sitemap or an external link, but it gets none of the internal signals and readers cannot navigate to it. Orphans usually appear after a redesign, when a campaign page is never linked, or when a hub forgets to list a new spoke. The fix is to link the page from its hub and from at least one related page, or to remove or redirect it if it no longer has a purpose.
Links that only exist after interaction
A hub that loads its list only after a click or scroll may show crawlers nothing. This is the same crawlable-markup problem from the earlier chapter. Check that your hub's links are in the HTML a crawler receives, as a elements with href values.
Everything linked from everywhere
You can force every page to depth 1 by linking all pages from the home page. A page with thousands of links gives each one almost no emphasis and is hard for readers to use. A flat structure also removes the topical grouping that hubs provide. The goal is to keep important pages close, not to make all pages equal.
Hubs that are too thin
A hub with only a title and ten bare links adds little. Give it a short introduction and a description for each link. If the hub only lists two pages, it may not need to exist, and linking those two pages from their parent may be enough.
Moving pages changes depth
Changing a slug or merging hubs changes the link graph. If you move a page, update the internal links to point at the new URL instead of relying on the 301 redirect. A redirect adds a hop for crawlers, and many redirects in a row form a chain. Re-measure depth after any restructuring.
Trade-offs
| Choice | Benefit | Cost |
|---|---|---|
| Few large hubs | Pages stay shallow | Hubs get long and unfocused |
| Many small hubs | Tight topical grouping | More levels, so some pages sit deeper |
| Heavy cross-linking | More ways to reach each page | Links stop being selective and become noise |
| Strict tree (one parent per page) | Simple to maintain and reason about | Related pages in other branches are hard to reach |
| Sitewide navigation links | Every page reachable quickly | Weak per-page signal, because the links are identical everywhere |
A practical default is a two-level hub structure with a handful of top-level hubs. Breadcrumbs, related-page links in the body, and a periodic depth check keep it healthy.
Check your understanding
Exercise
A site's home page links to a "Resources" hub at /resources/. The hub links to 40 articles. Each article is at /resources/category/article-name/. One article has no links from the hub, but is linked from another article that the hub does link to. What is that article's click depth, and what is the main risk with it?
Show answer
The hub is at depth 1, the linked article at depth 2, so the unlinked-from-hub article is at depth 3, because the shortest path is home, hub, other article, this article. The URL has three folders but that does not set the depth. The risk is that it is reachable only through one other article. If that article is removed, or the link in it is edited out, this page becomes an orphan. Fix it by linking it from the hub and from the related articles.
Exercise
In the Python example, why does click_depths check if target not in depths before assigning a depth?
Show answer
It makes sure each page is given its depth only the first time the search reaches it. Because breadth-first search visits pages in order of distance, the first visit is the shortest path, so later, longer paths must not overwrite it. The check also stops the search from looping forever when pages link to each other in a cycle, such as a hub and its spokes.