AI Prompts for Internal Linking and Better Site Architecture

Dew drops on a spider web, representing a connected internal linking network

AI prompts for internal linking work when you give the model a real inventory of your site (every published URL with its title and a one-line summary) and ask it to propose specific links with a source sentence, a destination and descriptive anchor text, which you then review. Without that inventory, a model will invent pages or suggest generic links; with it, it can find related posts, spot pages nothing links to, and group content into topic clusters faster than a manual review.

Internal links are links from one page on your site to another. They help readers move to related material and help search engines discover pages and understand how they relate. This guide walks through building the inventory, four prompts in the order you would use them, a worked example, and the mistakes that make AI-suggested links do more harm than good.

What Google says about links

Google’s documentation on making links crawlable sets the ground rules that every prompt in this guide follows:

  • Use real HTML links. Google can generally only follow a link that is an <a> element with an href attribute. Navigation built from onclick handlers or span elements may not be followed.
  • Every important page needs at least one link. The page says every page you care about should be linked from at least one other page on your site. A page with no internal links pointing to it is called an orphan page.
  • Anchor text should describe the destination. Anchor text is the clickable text of a link. Google advises text that makes sense on its own, is reasonably concise, avoids generic phrases like “click here”, and is not stuffed with keywords. The sentence around the link adds context too.
  • There is no ideal number of links per page, though an excessive number is likely a problem.

Accessibility guidance points the same way. The W3C’s explanation of WCAG success criterion 2.4.4, Link Purpose (In Context), a Level A requirement, asks that a link’s purpose be clear from its text or its immediate context, so screen reader users can decide whether to follow it. Descriptive anchors serve both audiences.

Step 1: Build the inventory

The inventory is a table of every published page you might link to. It is the single biggest factor in whether AI linking suggestions are usable, because a model can only suggest links to pages it has been told exist. At minimum, include:

ColumnPurposeHow to get it
URLThe exact destination, so the model cannot invent oneYour XML sitemap, a crawler export, or the WordPress REST API
TitleWhat the page is about, in your wordsSame source
One-line summaryWhat the page answers that its title might not showThe meta description or excerpt, or a model-written summary you check
Main query or topicHelps the model group pages and avoid linking two pages that competeSearch Console or your keyword notes
Inbound internal linksFinds orphans and weakly linked pagesA site crawler’s inlinks report, or Search Console’s Links report
StatusMarks pages being merged, redirected or retiredYour own notes

The status column prevents a common problem: linking to a page you are about to merge or redirect. Mark those rows clearly (“do not link”) and repeat that rule in every prompt. On WordPress, a request to /wp-json/wp/v2/posts?per_page=100&_fields=id,link,title,excerpt returns published posts in pages of up to 100, which is a quick way to start the table.

Step 2: Map topic clusters and find orphans

Before adding individual links, get a view of the whole site. A topic cluster is a group of pages on one subject, usually with a broad “hub” page linking out to narrower pages that link back. The first prompt asks the model to propose clusters and identify pages that are isolated.

Below is the inventory of my site as a table:
url | title | summary | main_topic | inbound_links | status

<inventory>
[paste table]
</inventory>

Tasks:
1. Group the pages into topic clusters. Name each cluster and list
   its pages. A page can belong to only one cluster. Put pages that
   fit nowhere under "Unclustered".
2. For each cluster, suggest which page should be the hub: the
   broadest page that could reasonably link to all the others.
   If no page is broad enough, say so.
3. List every page with 0 or 1 inbound_links. For each, suggest 2-3
   pages from the inventory that should link to it, with one line
   on why a reader of the source page would want the destination.
4. Flag any pairs of pages that seem to target the same topic or
   question so closely that they may compete.

Rules:
- Use only URLs from the inventory. Never invent a URL.
- Never suggest a link to or from a page whose status says
  "do not link", "merging" or "redirect".
- If you are unsure a page fits a cluster, say so rather than
  forcing it.

The fourth task is easy to overlook and often the most valuable. Two pages competing for the same query is a site architecture problem that internal links cannot fix; it usually needs a merge. The guide on topical authority and content clusters covers how to design clusters, and AI prompts for keyword clustering helps when you are planning new pages rather than organizing existing ones.

Step 3: Find link opportunities inside one post

The cluster map tells you which pages should be connected; this prompt finds where, inside a specific article, a link would naturally fit. Run it once per post you are editing.

Here is a post from my site and my site inventory.

<post url="[URL of this post]">
[paste full post text]
</post>

<inventory>
[paste table]
</inventory>

Find 3-5 places in this post where a link to another page in the
inventory would help a reader. For each, return:

1. The exact sentence from the post, quoted.
2. The destination URL (from the inventory only).
3. The anchor text: words that already appear in that sentence,
   or a minimal rewrite of the sentence if no existing words fit.
4. Why a reader at that point would want the destination page.

Rules:
- Do not link this post to itself.
- Do not link to pages marked "do not link".
- Prefer links inside the body text over a list at the end.
- Use each destination only once in this post.
- Anchor text must describe the destination page, be 2-8 words,
  and not be "click here", "this article", "read more" or a bare URL.
- Do not repeat the destination's exact title as anchor text unless
  it reads naturally in the sentence.
- If fewer than 3 links would genuinely help, return fewer.

Why the main rules are there:

  • Quoting the exact sentence lets you find the spot in your editor in seconds and confirms the model is reading your text, not paraphrasing it.
  • “Words that already appear in that sentence” keeps the post’s wording intact. A link that requires rewriting a paragraph is rarely worth it.
  • “Why a reader would want the destination” is the quality filter. If the reason is weak (“both are about SEO”), skip the link.
  • “Return fewer” gives the model permission not to force links, which it otherwise tends to do to meet the number you asked for.

Step 4: Review anchor text across the site

Anchor text problems are easier to see across many links than in one post. If twenty posts all link to your guide with the same exact-match phrase, it reads as automated. This prompt reviews a list of existing links, which you can export from a crawler as source URL, destination URL and anchor text.

Below are internal links on my site:
source_url | destination_url | anchor_text

<links>
[paste rows]
</links>

Review the anchor text and list:
1. Generic anchors ("click here", "here", "this post", "read more",
   bare URLs), with a suggested replacement that describes the
   destination.
2. Destinations where most links use the identical anchor text.
   Suggest 3 natural variations for each.
3. Anchors that describe something different from the destination
   page's topic (based on the URL and any titles you can see).
4. Empty anchors or links whose text is only an image.

Return a table: source_url | destination_url | current_anchor |
problem | suggested_anchor. Do not suggest changes to anchors that
are already descriptive and varied.

For image-only links, Google uses the image’s alt attribute as the anchor text, so the fix is often better alt text rather than a new link. The guide to AI prompts for writing alt text covers that case.

A worked example

The example below is illustrative. Suppose a small blog about cloud infrastructure has 60 posts, and the inventory shows a post titled “Setting up Terraform remote state in Azure” with zero inbound links. The cluster prompt places it in an “Infrastructure as code” cluster with a broader post, “Terraform basics for small teams”, as the hub, and suggests two sources: the hub and a post on “Locking down Azure Storage accounts”.

Running the in-post prompt on the hub returns, among others:

1. Sentence: "Once more than one person runs Terraform, the state
   file can no longer live on a laptop."
2. Destination: https://example.com/terraform-remote-state-azure/
3. Anchor: "the state file can no longer live on a laptop"
   -> suggested shorter anchor: "state file"
   Alternative minimal rewrite: "...the state file needs a shared
   home, such as remote state in Azure Storage."
   Anchor: "remote state in Azure Storage"
4. Reason: a reader who has just learned state must be shared will
   want the setup steps next.

The second anchor option is the better one: it is short, describes exactly what the destination covers, and the small rewrite makes the sentence more useful on its own. The reviewer’s job here is to pick between the options and confirm the destination page really delivers what the anchor promises.

Common mistakes with AI-suggested links

Letting the model guess URLs

Without an inventory, models construct plausible URLs from titles, and many will 404. Even with an inventory, check every suggested URL against it before publishing; a single typo in a slug creates a broken link.

Linking because pages share a word

Two posts that both mention “prompts” are not necessarily related for a reader. Require a reason in every prompt and reject suggestions whose reason is only a shared keyword.

Adding a block of “related posts” instead of contextual links

A list of links at the end of every post is easy to automate but gives readers and search engines less context than a link in the sentence where the topic comes up. Use contextual links for the important connections and leave automated related-post widgets as a secondary layer.

Linking to pages you are about to change

Links to pages that will later redirect add an extra hop for readers and crawlers. Keep the inventory’s status column current and update internal links to point to the final URL when you merge pages.

Letting an automation insert links without review

Plugins and scripts can insert links into posts in bulk, but a model’s suggestions still need a human check for relevance, accuracy and tone. A reasonable compromise is to have the model produce a table of suggestions and apply only the rows you approve.

Making internal linking a habit

Internal linking decays as a site grows: new posts link to old ones, but old posts rarely link to new ones. Two small routines keep it in shape:

  1. When you publish, run the in-post prompt on the new article, then run it in reverse: give the model the new post’s summary and the cluster’s existing posts, and ask which of them should now link to the new page and from which sentence.
  2. Each quarter, export inbound link counts, rerun the cluster and orphan prompt, and review anchor text for the pages that gained the most links.

When you refresh an older article, adding links to newer posts is part of the job; the guide to refreshing old blog posts with AI prompts includes that step.

FAQ

How many internal links should a post have?

Google’s documentation says there is no ideal number, while noting that an excessive count is likely a problem. A practical rule is to link wherever a reader would genuinely benefit and stop there. A long tutorial might reasonably carry several contextual links; a short answer page may need only one or two.

Should internal links use nofollow?

Google’s link guidance describes nofollow for external links you do not vouch for, and for paid or user-generated links. It does not suggest using it on links between your own pages. If you do not want a page found through your links, a noindex rule or removing the page is the clearer tool.

Sources

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top