Skip to main content
Lifetime license included with every purchase
n8n workflowsinternal linkingSEO automationAI content

Automate SEO Internal Linking Across Your Site with n8n

Build an n8n internal linking automation that crawls your sitemap, finds orphan pages, suggests anchor-and-target links with AI, and gates edits for review.

Nn8n Marketplace Team·August 17, 2026·Updated August 17, 2026·7 min read

Internal linking is one of the highest-ROI on-page SEO levers, and it's the one that rots fastest. Every new post should link to relevant older ones and earn links back, but nobody remembers the forty existing posts well enough to do it by hand. So new content lands orphaned, old content stops getting link equity, and the site's topical structure quietly decays. An n8n internal linking automation keeps it maintained: crawl the site, find the gaps, suggest the links, and let a human approve.

What ranks for this query is thin. A premium-gated community post with no node detail. A link extractor that finds links but suggests none. Hyperlinks baked into a writer agent that only helps brand-new posts. None of them crawl an existing sitemap, suggest anchors for published pages, and write back. That's the workflow below.

What internal-link automation handles

The job is bigger than inserting one link:

  • A crawled index of every page and its topic
  • A link graph showing what currently points where
  • Orphan-page detection for pages nothing links to
  • AI-suggested anchor text and target pages per post
  • A review sheet before any edit touches the CMS
  • A write-back step that inserts approved links

Run it on the content you maintain. Crawling pages you'll never edit just builds a map you don't act on.

The internal-linking pipeline

Schedule trigger → Crawl sitemap → Build page index + link graph
       → Detect orphans → AI suggests links → Review sheet → CMS write-back

A Schedule trigger kicks it off. The workflow crawls the sitemap, builds an index and a link graph, flags orphans, asks an LLM for relevant links per page, writes suggestions to a sheet, and only writes back to the CMS after approval.

1. Crawl the sitemap

Start from sitemap.xml. An HTTP Request node fetches it, a Code node parses the URLs, and a loop fetches each page. Use the HTML Extract node to pull the title, the main content text, and the existing internal links per page. Be polite, add a Wait node between fetches so you don't hammer your own server, and respect the Webhook node's 120-second default timeout by keeping per-page work light.

2. Build the index and the link graph

Store two things in Sheets: a page index (URL, title, topic summary) and a link graph (source URL to target URL for every existing internal link). The topic summary is worth generating once with an LLM, it's what makes later suggestions land on genuinely related pages instead of keyword-matched ones.

3. Detect orphans

Compare the link graph against the full URL list. Any page that appears as a target zero times is an orphan, no other page links to it, so search engines and readers struggle to find it. Flag these first; they're the highest-value fixes.

A page index beats keyword matching for suggestions

The naive version greps each post for a keyword and links it to whatever page mentions the same word. That produces links between pages that share a word but not a topic, which reads as spam and helps nothing. Build a topic summary per page first, then ask the LLM to suggest targets by topical relevance, not string match. A post about webhook security should link to the auth-setup guide even if neither shares an exact phrase. The index is the upfront cost; relevant suggestions are the payoff.

4. Suggest anchors with the LLM

For each page, pass its content plus the candidate target pages (title and topic summary) to an OpenAI node. Ask for two or three suggestions, each with a target URL, proposed anchor text, and a one-line reason. Cap it, a post stuffed with twelve internal links looks worse than one with three good ones. Parse the JSON response in a Code node before writing it anywhere.

5. Review, then write back

Write every suggestion to a review sheet: source page, target URL, anchor text, reason, status. An editor approves or rejects. Only approved rows hit the CMS write-back, an HTTP Request or the WordPress node that inserts the link into the post body. Auto-inserting links produces clumsy anchors and links to weak pages, so the gate earns its place.

Implementation patterns worth copying

Pattern: incremental crawls, not full re-runs

A full-site crawl every night is wasteful and rude to your server. Store a last-crawled timestamp per page and only re-crawl pages changed since, plus any new sitemap entries. The Content Scheduler & Distributor uses the same Sheet-driven state pattern, acting on what changed instead of reprocessing everything each run.

Pattern: link new posts both ways

When a new post publishes, do two passes: suggest outbound links from the new post to relevant old ones, and suggest inbound links from old posts to the new one. The second pass is what rescues new content from orphan status on day one, and it's the half most manual linking forgets.

Pattern: cap links per page and per target

Track how many internal links each target already has. Spread equity instead of piling every suggestion onto the same three popular pages. A simple count in the link graph drives this, skip a target once it's well-linked. The reverse matters too: a source page with twenty internal links dilutes every one of them, so cap outbound links per post and let the LLM pick the strongest few rather than every plausible match.

A word of caution before you point this at a live site. The CMS write-back edits published content, so a bad anchor or a wrong target ships straight to readers and search engines. Keep the review gate strict at first, log every edit with the old and new body so a rollback is a copy-paste, and run the write-back against a staging copy until the suggestions earn your trust. Internal linking is high ROI precisely because it touches real ranking pages, which is the same reason a careless edit costs more than the link is worth.

n8n nodes you'll use most

NodePurpose
HTTP RequestFetches the sitemap and each page
HTML ExtractPulls title, content, and existing links
CodeBuilds the link graph and detects orphans
OpenAISummarizes topics and suggests anchor links
Google SheetsHolds the index, link graph, and review queue
WordPress / HTTP RequestWrites approved links back to the CMS

Getting started

  1. Point an HTTP Request node at your sitemap.xml and parse the URLs.
  2. Loop the pages with a Wait between fetches, extracting title, content, and links.
  3. Store a page index and a link graph in Google Sheets.
  4. Flag orphan pages that appear as a link target zero times.
  5. Ask an LLM for two or three topically relevant link suggestions per page.
  6. Write suggestions to a review sheet and let an editor approve.
  7. Write back only approved links, capping links per page and per target.
Browse content automation templates
Skip the build

The Content Scheduler & Distributor ships the Sheet-driven engine this workflow runs on: it reads a queue from Google Sheets, filters what's due, processes each item with OpenAI, and tracks state so it acts on changes instead of reprocessing the whole list, the same crawl-state and review-queue backbone internal linking needs. It's part of The Complete n8n Templates Bundle, a one-time lifetime license to the whole catalog plus every template added later, worth it once you run more than one content automation.

Get the Content Scheduler & Distributor

For the content these links connect, turn a podcast into a blog post with n8n produces the new drafts that need inbound links on day one, and automate content translation with n8n shows the same crawl-and-write-back pattern applied to localized variants. When a freshly linked post needs a social push, the Social Media Scheduler & Designer generates the caption-and-graphic pair.

Compare content automation templates
FAQ

Common questions

How do I automate internal linking with n8n?
Crawl your sitemap to build a page index of URLs and topics, then for each page have an LLM suggest two or three relevant target pages with anchor text. Write the suggestions to a Google Sheet for review, and only after approval does a CMS write-back step insert the links. The page index is the part that makes suggestions accurate.
Can n8n find orphan pages on my site?
Yes. Build a map of every page and every internal link from the sitemap crawl, then flag pages that no other page links to, those are orphans. n8n's HTML Extract node pulls links per page, and a Code node compares the link graph against the full URL list to surface the orphans.
Should internal-link edits be applied automatically?
Route them through review first. Have the workflow write suggested anchor-and-target pairs to a sheet, let an editor approve, and only then run the CMS write-back. Auto-inserting links risks awkward anchors and links to weak pages, so the approval gate keeps the SEO upside without the editorial mess.
Stop reading. Start running.

Get the workflow templates this guide is built on

Import-ready n8n JSON, step-by-step setup, and tested end-to-end. One-time payment, own it forever.

Free — $40 value

Get 3 tested n8n templates, free

The full customer package for three real catalog templates — workflow JSON, step-by-step setup guide, credential checklist. Built through the same live-instance release process as everything we sell. Plus new templates and automation guides in your inbox. No spam, unsubscribe anytime.

  • 01Smart To-Do List ManagerPre-built n8n workflow template that automates productivity with OpenAI. Live in about 10 minutes.$14
  • 02Email Follow-Up AutomatorPre-built n8n workflow template that automates crm with OpenAI. Live in about 15 minutes.$12
  • 03Market Trend AnalyzerPre-built n8n workflow template that automates data processing with OpenAI. Live in about 10 minutes.$14