Template
Automate Internal Linking using AI
Automate Internal Linking using our Free Tool. Inject Relevant Internal Links Naturally throughout your Blog Posts at Scale.
Manually weaving internal links through dozens of blog posts is slow, easy to miss, and often ends in a scatter-shot web of half-relevant anchors. Search engines—and users—reward a well-connected site, but keeping up as new content rolls out every week is a chore. Our “Add Internal Links” app leans on semantic search and an LLM to place context-rich links automatically, so every new post supports the rest of your library without hours of copy-and-paste.
How the App Works in Moonlit
1. Inputs
Input | Description | Example |
---|---|---|
Sitemap URL | The XML file that lists every indexable page on your website. | https://yourdomain.com/sitemap.xml |
Blogs Slug Prefix | A filter to include only blog articles (not product or legal pages). | /blog/ |
Target Post URL | The specific article you want to improve with more internal links. | https://yourdomain.com/blog/underlinked-article |
2. Step-by-Step Logic
Step 1 – Pull the raw material
• Extract Sitemap URLs scans the XML file, grabs up to 300 URLs under the given prefix, and returns a table of url / title / description. That’s the universe of potential link sources.
• Scrape Webpage fetches just the body text of the target post (headers and nav stripped) so the model can read it like a human would.
Step 2 – Find the best matches
• Semantic Retrieval takes the full target content as a query, then ranks every row from the sitemap table by semantic similarity (not just keyword overlap). The top 30 pages it returns are likely to add genuine topical depth.
Step 3 – Inject links naturally
• Chat Model (DeepSeek-Chat) receives:
– the shortlist of relevant pages (URL, title, description)
– the full target article text
– a detailed prompt that: a) stresses natural language edits, b) discourages link stuffing, and c) instructs the model to output the revised article only.
The model rewrites just enough surrounding text to fit each link organically—similar in approach to the strategies discussed in Building High Quality AI Content Pipelines—keeps spacing sensible, and skips any forced fits. If nothing truly relevant exists, it simply says so—no junk links added.
Outputs
Improved Article – ready-to-publish HTML with internal links in place.
Original Article – handy for side-by-side comparison or QA.
Customization Ideas
Tune the page pool – raise or lower the sitemap limit (300 by default) to match site size, or swap in a curated CSV of high-authority pieces only, as seen in our Lead Alchemists Case Study.
Adjust similarity breadth – change num in Semantic Retrieval (e.g., 10 for stricter topical focus, 50 for broader coverage).
Rewrite rules – edit the Chat Model prompt to set a max links per paragraph, specify anchor-text length, or require calls-to-action.
Anchor-text strategy – add a Python step that feeds in preferred anchor phrases based on page tags or keyword lists.
CMS push – append an API step to auto-update the post in WordPress, Webflow, etc., once the links look good. You can also reference techniques for maintaining a consistent brand voice across multiple pages.
Running at Scale with Bulk Runs
Export a CSV with three columns: sitemap_url, blogs_prefix, target_post_url (one row per article you want to optimise).
Open Bulk Runs, select the “Add Internal Links” app, and upload the CSV.
Map each column to its matching input, hit Run, and watch the job iterate through every row—no tab-hopping required.
Download the results as a csv of revised HTML strings or pipe them straight into your CMS.
Why It Matters
Teams spend several hours a week combing through archives, hunting for anchor text, and double-checking links. Automating that grunt work frees you to plan new content and strategy while still reaping the rewards: stronger topical authority, smoother user journeys, and fewer orphan pages.