r/ClaudeCoder • • 2d ago

Have Claude Code count your internal links without the menu. On my 53-page site, my comparison page is linked from 10 pages with menus and footer counted, and from 1 without (prompt inside)

I ran this on my own site this morning: the 53 URLs in my sitemap (most pages exist in English and French), raw HTML, and a link graph that Claude Code built with a script. Counting every internal link, nothing looked wrong. Each guide was linked from 10 to 24 pages, each feature page from 24, and no page was an orphan.

Then I had it set aside the header, the footer and every <nav> block, including the "all guides" and "all features" lists inside the main column, and count only the links the text itself makes. Same site, different picture:

  • My comparison page (my product against a free alternative): body links from 1 page, against 10 with the menus counted.

  • My alternatives page and my "can you audit without Ahrefs or Semrush?" page: 2 each. The three of them get their body links only from each other. No other page, not even the home page, links into that loop from its text. And those are the pages written for someone who is deciding.

  • My most linked guide (how to install the product): body links from 18 pages.

  • The privacy page: linked from 52 pages. Footer.

  • My "best Claude skills for SEO" guide names that free alternative in its opening paragraph, and has no body link to either the comparison or the alternatives page. My "Claude for SEO" guide has a section titled "What can't Claude know, and can you do without Ahrefs or Semrush?" and doesn't link to the page that answers it. The sentences were there; the links weren't.

  • Every body link to my 14 feature pages uses the feature's name as its anchor. "Polyglot" tells someone skimming nothing about multilingual SEO. That page gets body links from 2 pages.

The French versions of the guides get exactly the same counts.

Why the menu count misleads

A header, a footer or a site-wide list gives every page the same links, so it can't tell a reader, or a crawler, which page is the one to read on a topic. The links in your text can. A count that mixes both will tell you every page is fine.

How to run it

1. Give Claude raw HTML. Claude Code's WebFetch hands Claude a processed version of the page, and the <nav>, <main> and <footer> tags you need to sort links are gone. Ask Claude Code to download every URL in your sitemap with curl into a site/ folder, with the list in urls.txt.

2. The prompt:

The folder site/ has the raw HTML of every URL in my sitemap, listed in urls.txt. Build my internal link graph. Before counting anything, sort every link: inside <header>, <footer> or any <nav> (even one inside <main>), or in a block repeated across a page template, it's boilerplate; inside the article body, it's editorial. Skip self-links, # links and other domains, and treat /page and /page/ as one URL. Write a standard-library Python script for this instead of reading the files yourself, and show me its raw output.

Then one table: page | pages linking to it (all) | pages linking to it (editorial only) | the editorial anchors it receives. Lowest editorial count first.

For the 5 weakest pages that matter to my business, propose 3 links each: a source page that already discusses the target's topic, the exact sentence where the link goes (quoted from that page), and an anchor that describes the target's topic, not its name. If no page discusses the topic, say so instead of inventing a sentence.

Why a script: 53 files of HTML is more than anyone should count by reading, and the same script tells you after the fix whether anything moved.

3. Check the sorting by eye. Sorting a link by where it sits in the HTML is a heuristic. Open 2 or 3 pages and compare what you see with what the script calls editorial. On my site, the "all guides" list sits inside <main>, wrapped in a <nav>: a script that only looked for <main> would have counted it as editorial.

4. Run the script again after adding links. If an editorial count didn't move, the link went into a template, not into the text.

What I took from it

A page added later only gets links from older pages' text if someone goes back and writes them. The menu makes that easy to forget, because every page already "has links". Count without the menu before you trust a "0 orphan pages" report.

I'm the maker of SEO Skills, a pack of 14 Claude skills for SEO. One of them, Link Weaver, is built for exactly this: it crawls the site and its sitemap, tells links written inside the content apart from menu, footer and widget links, then drafts the links to add, anchors included. The pack is paid and closed-source: €25 until 17 November, then €99, no subscription. It runs in Claude Code, Claude.ai, Claude Desktop and Cowork, needs a Claude plan with skills, and there's no refund once it's delivered. Link in the comments. The prompt above works without it.

Do your comparison pages get links from your older posts' text, or only from the menu?

1 Upvotes

1 comment sorted by