Add internal links with Claude without breaking anything
Claude proposes each link as a row you approve, quoting a sentence already on your page. Every edit goes in a log you can undo.
Written by the IndieHacked teamSearch6 min read
Claude can find where your pages should link to each other, but have it propose the links as a table and approve each row before it edits a file.
Every row quotes a sentence that is already on the live page, so a quote you can't find there is one Claude invented.
Add 3 to 5 links a page, give each target one anchor of its own, point links toward the pages that sign people up, and log each change so it can be reverted.
Want your coding agent to walk you through it?Get the prompt
What a link inside a sentence does
Google finds most new pages through links from pages it has already crawled, and it reads a link as a signal of what the page it points to is about. Its link guide asks that every page you care about gets a link from at least one other page on your site, placed in context. A link in the menu or the footer sits on every page alike. A link inside a sentence says why this page leads to that one, to Google and to the reader.
Claude is fast at this work. Give it your pages and it finds the sentences that already name another page. It is just as fast at writing a sentence that reads well and isn't on your site, or at editing fifty files before you have seen one. The steps below keep the speed and put your approval between the idea and the edit.
Start with the pages that need links in
Decide where links should go before you ask for any. Compare the URLs in your sitemap with the pages that some other page's body links to. A page in the sitemap that no body links to is an orphan: readers reach it from the menu or not at all.
Then name your money pages, the ones that sign people up or sell: a feature, a free tool, the pricing page. Links should lead toward them from pages on the same topic. A tutorial links to the feature it teaches, a buying guide to the offer, an alternatives page to the guide for switching.
Ask for a table, not an edit
Tell Claude it may not change a file in this step. It returns one row per proposed link, and nothing is written until you approve the rows.
- Source page: the URL the link goes on.
- Sentence: copied word for word from that page as it is live today.
- Anchor: the words in that sentence that become the link.
- Target: the URL the link points to.
- Target's search: the query that page is meant to rank for, with its position from Search Console once you have the data.
Read the anchor and the target's search side by side. When they describe different things, the link points at the wrong page, or the target has no clear search of its own yet.
Check every quote against the live page
Open each source page and search it for the quoted sentence. If it isn't there, Claude wrote it, and the row goes. Check the page readers get, not the file in your repo: a page filled in by JavaScript or a CMS can say something else. View the source and search it, the same test as in making your site readable to AI search. For a long list, Firecrawl returns each page as Markdown that Claude can search for its quotes.
Google crawls a link when it is an a element with an href. Its guide says most links in other forms aren't parsed, so ask Claude to write each link the way your site already writes links, never as a click handler on a span or a button.
Keep each page to a few links
- 3 to 5 new links a page. Google sets no ideal number and says that if a page looks like it has too many, it probably does. Five is our ceiling.
- None in a heading or in the page's first sentence. The first sentence often becomes the description under your result in search, and it should answer the question without sending the reader away.
- A page never links to itself, and each target appears once on a page.
- One anchor, one page. Words that link to one page on your site never link to another, or neither page owns them. Google names "click here" and "read more" as anchors to avoid: write ones that make sense read alone.
- Keep links in separate sentences. Google's guide advises against links chained one after another.
Log every change so you can undo it
Once you approve the table, Claude edits only the approved rows and adds each one to a change log: the date, the source page, the sentence, the anchor and the target. A wrong link is then one row to find and one edit to revert. Next to each source page, note its impressions and position in Search Console on the day you change it, and read them again a month after Google has crawled the page again.
Links bring readers to a page. Its title and description decide whether searchers click it, and our guide to writing page titles has the rules we hold ours to. Run your money pages through the SEO check while you are at it.
Make the build hold the rules
Rules in a prompt last one session. On the three sites we run, they moved into the build, so a link that breaks one stops the deploy.
- IndieHacked: a guide's body can carry a link inside its sentences. The build fails on a link to a path that is no page, a target linked twice, a guide linking itself, an outside address the guide doesn't list in its sources, or more than 5 links in one guide. The first 7 went in on 5 November 2026.
- BDYCTRL: ten articles carry 19 links between them, kept in one list beside the articles instead of typed into them. Each entry names the phrase it wraps, and the build fails unless that phrase appears exactly once in its article. That is the quote check above, run on every deploy.
- Buzzmark: an audit on 21 October 2026 found that its features page, its FAQ and its social media calendar got links from the header and footer only, none from any page's text. The fix wrote the links into the shared page templates instead of page by page. Counted on the built site the same day, the features page had 26 links in, the FAQ 19 and the calendar 12.
If you add links every month, save the prompt as a skill in your project, so the rules come with it to every session.
Set it up with your coding agent
A prompt for Claude Code, Codex, Cursor or the agent you use. Fill in your setup at the end and it walks you through the work, one step at a time. Free with an account.
Questions founders ask
Do links in the menu and the footer count?
Google crawls them, so they help it find your pages. They sit on every page alike, which says little about how one page relates to another. Google's advice is to link in context, inside the text, to the pages that help the reader understand the one they are on.
How do I find the pages nothing links to?
List every URL in your sitemap, then every URL that some page's body links to. A URL in the first list and not the second is an orphan. Claude can build both lists from your repo or from the live pages; ask it to show you the orphans before it proposes a single link.
Can Claude add the links in a CMS like Webflow or WordPress?
Only where it can reach the content, through your repo or an API you connect it to. Otherwise have it make the same table and make the approved edits yourself in the CMS. The table and the log work the same either way.
Where to go next
- The Directory
Apps and tools indie founders built, by category.
- List your product
Built it? Add it to the Directory, free or with a plan.
More guides
All guidesBuilding with AI9 min read
The most common mistakes AI makes on the web
AI search8 min read
How to claim your business in ChatGPT and add products
A new guide every few days.
Weekly Unpack brings each one to your inbox. One email a week with founder stories, the playbooks behind them and the businesses we unpack in our interviews.
Plusand the Builder Kit come with it
Subscribing makes your account Plus and opens your Builder Kit: what your product needs next, written for your coding agent to do.