Blog Architecture Audit: Click Depth, Orphan Pages and Hub Coverage (Python)
Blogs grow sideways. New posts push older ones deeper, categories fill unevenly, and some pages end up with no links pointing to them at all. This free Python script audits how your blog, or your whole site, is actually connected, and turns the results into a prioritised fix list. It is the only architecture tool in the library.
The five questions it answers
- Click depth. How many clicks from the homepage is each page, and which pages are deeper than three?
- URL depth vs click depth. Which pages look shallow in their URL but are buried in the links?
- Orphans. Which sitemap URLs have no internal links, which can’t be reached from the homepage, and which posts have one contextual (in-content) link or fewer?
- Category balance. Which sections are thin (fewer than three posts) or dominant (more than 40% of posts)?
- Hub coverage. Does each category or hub page link to all the posts in its folder, or only the latest few?
It also counts tag, author, date-archive, pagination and parameter URLs found in the crawl, so you can see how much archive clutter you have.
Who it’s for
Content-site owners and SEOs restructuring a blog, planning topic clusters, or tidying up after years of publishing.
How to use it
- Install the requirements locally, or in Google Colab with
!pip install. - Sitemap mode: point it at your XML sitemap or sitemap index. It reads every sitemap URL, then crawls from the homepage following normal links on your host, counting nav, header and footer links separately from in-content links.
- Or Screaming Frog mode: give it the Internal (HTML) export and, for hub coverage and the contextual split, the All Inlinks export. Add your sitemap to find orphans.
- Adjust the options if your URLs are flat:
--post-patternand--hub-patterntell it which URLs are posts and hubs. - Read
summary.md, then work through the CSVs.
What you get
pages.csv (depths, inlinks and flags per page), orphans.csv, sections.csv, hubs.csv and a Markdown summary printed to the console.
Limits
- It doesn’t render JavaScript, so links injected client-side are missed. Use Screaming Frog with rendering for those sites.
- Click depth counts navigation links, which is how search engines discover pages but can make a site look shallower than it feels to readers. Use the contextual inlinks column for the in-content picture.
- Orphan detection depends on your sitemap: pages missing from both the sitemap and your links stay invisible.
- Free to run. Be polite with the crawl delay and only crawl sites you own or have permission to crawl.
I discuss what the results mean, and the structure I recommend, in Blog and Site Architecture for SEO and Conversions in the AI Search Era.
What’s included
- Click depth from the homepage for every page, with pages deeper than three clicks flagged
- URL depth vs click depth, to find pages that look shallow but are buried
- Orphan pages, unreachable pages and posts with one contextual link or fewer
- Category balance (thin and dominant sections) and hub coverage per category
- Archive hygiene counts and a summary.md report
Where this resource is used on MLforSEO
Walkthroughs on the blog
Concepts behind it
More internal linking resources
- Coding Script or NotebookInternal Link Audit and Topic Clustering Notebook with Embeddings
- No-Code TemplateInternal Link Opportunities Quick Find (Google Sheets Template)
- Coding Script or NotebookML-Powered Internal Linking Opportunity Discovery with LinkBERT
- Content audits · No-Code TemplateContent Audit Template: Search Console, GA4 and Crawl to Keep, Update, Merge or Prune (Google Sheets)
- Content audits · ChecklistSEO Site Migration Checklist + Redirect Mapping Workbook
- Content audits · Coding Script or NotebookAI Crawler Access Checker: robots.txt, llms.txt and Bot Rules
See all 4 internal linking resources →See all 16 content audits resources →See all 42 coding script or notebook resources →
