Skip to content

Internal linking audit and fix

Find orphan pages and broken links, and add related links from your data so every page is reachable.

  • Free, no sign-up
  • 1 to 2 hours with an agent
  • By Devvrat Hans
  • Version 1.0, updated Oct 26, 2026

1Your site and stack

Optional. The prompt adapts as you type; leave a field blank and the agent works it out.

2Copy it into your agent

internal-linking.md66 lines, about 903 tokens

Paste into any coding agent: Claude Code, Cursor, Codex, Copilot, Windsurf or Cline.

# Internal linking audit and fix

Search engines find and weigh pages of the production site through its internal links. Pages nothing links to (orphans) are found late or not at all, broken links waste crawls, and 'click here' anchors say nothing about the target. Audit the link structure and fix it with links generated from the site's own data, so new pages are linked from the moment they exist.

Site: not given. Find the production URL in the project config, or ask me.

## Ground rules

1. Read before you write. Explore the parts of the codebase this job touches and tell me what is already in place.
2. Plan, then stop. Give me a numbered plan: what you will change, in which files, and why. Wait for my approval before editing anything.
3. Fix things at their source (the shared layout, the config, the generator), not with one-off patches page by page.
4. Keep the project's conventions: its framework APIs, file layout, naming and code style. Add no new dependency without asking.
5. Where something is already done well, say so and leave it alone.

## You will not

- Edit `.env` files, secrets or API keys, or print their values.
- Deploy, push, merge or publish anything.
- Delete data, or run migrations or scripts against a production database.
- Add tracking, third-party scripts or links to any site I did not ask for.
- Change copy, design or behaviour that this job does not need.
- Add links to external sites.
- Change the main navigation design without showing me first.

## Your stack

- Framework: Work out the framework, router and build output from the project files (package.json, lockfiles, framework config) before planning, and say which you found.
- Host: Work out where the site is hosted from the config files (vercel.json, netlify.toml, wrangler config, Dockerfile, fly.toml) and say which you found.

## Steps

### 1. Build the link graph

From the routes and templates (or a crawl of the local build), work out which pages link to which. Report: orphan pages (in the sitemap or routes but linked from nowhere), pages more than three clicks from the homepage, broken internal links, links that go through a redirect, and the most common anchor texts.

### 2. Fix the structure

- Every indexable page is linked from at least one hub or list page, and hubs are linked from the main navigation or footer.
- Lists with many items paginate with real `<a href>` links, not only a 'load more' button.
- Links are real `<a href>` elements with descriptive anchor text ("invoice templates", not "click here").
- Links point at the final URL, not one that redirects.

### 3. Related links from data

Add a 'related' block to content templates (posts, product pages, docs) built from data: same category or tag, shared keywords, or a hand-picked list where one exists. Keep it to three to six links, exclude the page itself, and make sure it renders in the server HTML.

### 4. Fix the broken ones and guard

Fix or remove every broken internal link. Add a test or build step that fails on internal links to routes that do not exist.

## Done means

- [ ] No indexable page is an orphan.
- [ ] Every indexable page is within three clicks of the homepage.
- [ ] No internal link is broken or goes through a redirect.
- [ ] Content templates show related links built from data, in the server HTML.
- [ ] A check fails the build on broken internal links.

## Report back

When you finish, give me:

- what you changed, file by file;
- anything you skipped, and why;
- anything I must do by hand (DNS records, dashboards, accounts, deploys);
- how to check each change on the live site.

One-line version

For agents that can read a URL. It fetches this prompt with your settings applied.

Read https://abacklaunch.com/prompts/internal-linking.md and follow it for this project.

3Check the result

When the changes are live, run these free checks. Add your site URL above and each one opens already running on it.

This prompt will not

  • Edit .env files, secrets or API keys, or print their values.
  • Deploy, push, merge or publish anything.
  • Delete data, or run migrations or scripts against a production database.
  • Add tracking, third-party scripts or links to any site I did not ask for.
  • Change copy, design or behaviour that this job does not need.
  • Add links to external sites.
  • Change the main navigation design without showing me first.

It reads your code first, shows you a plan, and waits for your approval before it changes anything.

What you get

  • A map of your internal links with orphans, deep pages and broken links found
  • Related links generated from your data on content pages
  • Fixed anchors and redirect-free links
  • A build check for broken internal links

How to use this prompt

  1. 1

    Describe your stack

    Add your site, framework and host. The prompt adapts; blank fields are left for the agent to work out.

  2. 2

    Paste it into your agent

    Open your project in Claude Code, Cursor, Codex, Copilot, Windsurf or Cline, and paste the prompt or the one-line version.

  3. 3

    Approve the plan

    The agent reads your code, shows you a plan with the files it will touch, and waits. Change anything you disagree with.

  4. 4

    Check the result

    When the changes are live, run the free checks below on your site to confirm each fix.

What the agent does

Search engines find and weigh pages of the production site through its internal links. Pages nothing links to (orphans) are found late or not at all, broken links waste crawls, and 'click here' anchors say nothing about the target. Audit the link structure and fix it with links generated from the site's own data, so new pages are linked from the moment they exist.

  1. 1. Build the link graph

    From the routes and templates (or a crawl of the local build), work out which pages link to which. Report: orphan pages (in the sitemap or routes but linked from nowhere), pages more than three clicks from the homepage, broken internal links, links that go through a redirect, and the most common anchor texts.

  2. 2. Fix the structure

    • Every indexable page is linked from at least one hub or list page, and hubs are linked from the main navigation or footer.
    • Lists with many items paginate with real <a href> links, not only a 'load more' button.
    • Links are real <a href> elements with descriptive anchor text ("invoice templates", not "click here").
    • Links point at the final URL, not one that redirects.
  3. 3. Related links from data

    Add a 'related' block to content templates (posts, product pages, docs) built from data: same category or tag, shared keywords, or a hand-picked list where one exists. Keep it to three to six links, exclude the page itself, and make sure it renders in the server HTML.

  4. 4. Fix the broken ones and guard

    Fix or remove every broken internal link. Add a test or build step that fails on internal links to routes that do not exist.

Done means

  • No indexable page is an orphan.
  • Every indexable page is within three clicks of the homepage.
  • No internal link is broken or goes through a redirect.
  • Content templates show related links built from data, in the server HTML.
  • A check fails the build on broken internal links.

Questions

How many internal links should a page have?

There is no magic number. What matters is that every page is reachable, important pages get more links, and anchors describe their targets.

Do 'load more' buttons hurt SEO?

If the extra items only load through JavaScript after a click, crawlers may never see them. Paginated pages with real links fix that.

Should internal links be nofollow?

No. Use nofollow for links you do not vouch for, such as user-submitted or paid links, not for your own pages.

Does this prompt add links to Aback Launch to my site?

No. Nothing in the prompt mentions Aback Launch or asks your agent to link to us. The only exception is an optional badge step, which stays off unless you tick it. Some prompt libraries slip their own link into your codebase by default; we think that should always be your choice.

Which coding agents does it work with?

Claude Code, Cursor, Codex, GitHub Copilot, Windsurf, Cline, and any agent that can read your project and edit files. You can copy it as a plain prompt, save it as a Claude Code skill or a Cursor rule, or add it to AGENTS.md.

Is it safe to run on my real codebase?

The prompt makes the agent read first, show a plan and wait for your approval, and it forbids touching secrets, deploying and deleting data. Still review the changes and run your tests before you deploy, as with any change.

Changelog

  • v1.0First version.

Launch your startup on Aback Launch

Get a launch page that search engines and AI assistants can read, a place in the weekly launch list, and a review by a real person. Free to join.