All articles
November 30, 2026

How to Find and Fix Broken Links in Your Docs

fix-broken-links-in-documentation-cover.png

With DocStar, broken links in your docs become a job you hand to your AI agent: connect Claude Code, Cursor or Codex to the DocStar MCP, ask it to check every published page, and it comes back with a list of dead links and proposed fixes, saved as drafts for you to review. DocStar also stops the most common cause of broken links before it starts, by adding a permanent (301) redirect whenever you rename or move a page.

This guide shows how to find and fix broken links in your documentation the agent-first way, and how to keep them from coming back.

#

Broken links rarely come from one big mistake. They pile up from small, normal changes:

What happened What the reader sees
A page was renamed or its slug changed Old links in other pages, emails and search results go nowhere
A page was moved to a different section Its path changes, along with its subpages' paths
A page was archived or deleted Every link to it lands on "not found"
You migrated from another docs tool Old URLs from Google, blog posts and support replies stop working
A third-party site you link to moved its page Your docs send readers to a dead external link
A heading was reworded Links to #old-heading anchors no longer jump to the right place

Each one is small. Together they hurt trust, waste support time and cost you search rankings. They also hurt AI agents: an assistant following a link from your docs, your llms.txt or a Markdown copy of a page hits a dead end and has to guess.

#

Before you fix anything, it helps to know what DocStar already handles for you. From our Redirects guide:

  • Rename a page's URL with Rename URL in the Publish & Preview panel, and DocStar redirects the old URL to the new one. Subpage URLs that change are redirected too.

  • Move a page to a new place in the sidebar, and DocStar redirects its old path to the new path.

  • Delete or archive a page, and DocStar may ask "Do you want to add redirection?" so you can send its visitors to another page.

These are permanent (301) redirects, so search engines move the old URL's ranking to the new one. They work on the DocStar link and on your custom domain. More on slugs in Page URLs and Slugs and our earlier post Redirections & Custom Slugs Made Easy.

So inside DocStar, renaming and moving are safe. What's left to catch is links to pages that were removed without a redirect, old URLs from before a migration, external links that died, and anchors that changed. That's where your agent comes in.

#

DocStar is built for AI-agent-first documentation work. Your assistant reads your docs, finds the problems and drafts the fixes. You review and decide.

#

Step 1: Connect your agent to the DocStar MCP

Add the DocStar MCP (https://mcp.docstar.io/mcp) to Claude Code, Cursor, Codex or any assistant that supports MCP, or add DocStar from your assistant's connector directory. The first time the agent needs your workspace, you sign in to DocStar in your browser. There's no API key to copy. Full steps: Connect your AI assistant.

The agent works with the same permissions you have. If you can only read a collection, so can your agent.

#

Step 2: Give it one prompt

Use the DocStar MCP to check every published page in our Help Docs collection for broken links. Check internal links against the pages that exist now, check anchor links against the page's current headings, and check external links to see if they still load. For each broken link, tell me the page it's on, the link, why it's broken, and the fix you suggest: the page's current URL, a better external source, or a redirect. Show me the full list before you change anything, then save the fixes as drafts.

Swap in your collection name. For a large docs site, ask it to work one section at a time.

#

Step 3: What the agent does

With the DocStar MCP connected, your agent can find pages, list collections, read pages, rewrite or fix them and save the new version, and rename pages and change their URLs. For a link check, that means it:

  1. Builds the list of live pages. It lists the collection's pages. Your docs also publish a sitemap.xml of every published page and an llms.txt index with links to the Markdown copy of each page, so the agent has a clean map of what exists.

  2. Reads every page and pulls out the links. Internal links, anchor links and external links.

  3. Checks each one. Internal links against the live page list, anchors against the current headings, and external links by requesting them (coding agents that can run commands, such as curl, can do this from their own environment).

  4. Works out the right fix. For a renamed internal page it finds the current URL. For a removed page it suggests the closest live page or a redirect. For a dead external link it suggests a current source, or removing the link.

  5. Shows you the plan. A table of every broken link and the proposed fix, before anything changes.

[Screenshot: Coding agent listing broken links and proposed fixes for a DocStar collection]

#

Step 4: Review, then let it fix

This is where you come in. Read the list and make the calls only a person can make:

  • Should this old page redirect somewhere, or is it gone for good?

  • Is the suggested replacement really the same content?

  • Do you still want to send readers to that external site?

Then tell the agent to go ahead. DocStar is safe by design here: the agent asks before it creates, changes or publishes anything, and every edit is saved as a draft. Nothing reaches your live docs until it's published.

#

Some broken links aren't in your docs at all. They're in Google results, old blog posts, partner sites and support replies, often pointing at URLs from before a migration. You can't edit those, so you redirect them.

In DocStar, open the collection, go to Settings > Redirections, type the old path in Enter slug, pick the destination page and click Add. The DocStar API also has URL Mappings endpoints to list and create redirects, so you can hand your agent a list of old URLs and ask it to propose a redirect for each one.

Here is a list of old URLs people still visit. For each one, find the best matching published page in our Help Docs collection and propose a redirect. Show me the list before adding any.

A few rules from the help docs worth knowing:

  • A redirect always points to a page in the same collection.

  • When you publish a page at a URL that has a redirect, DocStar removes that redirect so the new page is served.

  • Delete a redirect when you no longer need it, or when you want to reuse the old URL.

#

Step 6: Publish

Open the drafts, check the changes and publish. Or ask the agent to publish the pages you approved. Your docs site, llms.txt, Markdown copies and your collection's MCP server all serve the fixed pages.

#

Keep it current

Fixing links once is good. Keeping them fixed is better. A few habits do most of the work:

  • Rename and move pages inside DocStar. Don't delete a page and recreate it under a new name. Renaming and moving add redirects automatically. Deleting doesn't, unless you say yes to the redirection prompt.

  • Add a redirect before you archive a popular page. Say Yes when DocStar asks, so readers don't hit "not found".

  • Re-run the check after each release. Paste the Step 2 prompt again, or ask for just the pages that changed: "Check links on every Help Docs page updated this week."

  • Put the rule in your agent's instructions. Add a line to AGENTS.md or CLAUDE.md so your coding agent checks links whenever it edits docs:

## Docs links (DocStar)
When you rename, move or remove a page in DocStar, update every link to it in the same change and use DocStar's rename or move (not delete and recreate) so a redirect is added. Save as draft; publish only when asked.

If you keep Markdown pages in your repo with GitHub Sync, link changes also show up in the pull request diff, so reviewers see them like any other change.

For a wider review beyond links (outdated steps, missing pages, thin descriptions), see How to Audit Your Docs with an AI Agent.

#

You can do all of this by hand in the DocStar editor. Open a page, select the link text, update the URL and publish. For old URLs, add redirects in Settings > Redirections, and use the search box at the top of that tab to find pages, slugs and existing redirects. It works, but on a docs site with hundreds of pages, the agent is much faster at finding the problems in the first place.

#

Why teams choose DocStar

  • Redirects you don't have to remember. Renaming or moving a page adds a 301 redirect automatically, including for subpages.

  • An agent that does the tedious part. Your assistant reads every page, checks every link and drafts the fixes through the DocStar MCP.

  • You stay in control. The agent asks first, edits start as drafts, and your permissions apply.

  • Docs that work for AI too. Every published page has a Markdown copy, an llms.txt index and a hosted MCP server, so working links help AI assistants as much as people. More in Documentation Best Practices for People and AI Agents.

  • One workspace. API docs, help docs, FAQs, changelog and blog live together, with custom domains, branding and translation.

#

FAQ

#

DocStar prevents the most common cause by adding a redirect whenever you rename or move a page. Finding other dead links, such as links to removed pages, changed anchors or external sites, is a job for your AI agent: it reads your published pages through the DocStar MCP and reports what it finds.

#

No. DocStar redirects the old URL to the new one, and redirects subpage URLs that change too. The same happens when you move a page in the sidebar.

#

Do redirects hurt my SEO?

DocStar uses permanent (301) redirects, so search engines move the old URL's ranking to the new one. Stable URLs are still best, so settle slugs before you share links widely.

#

Can a redirect point to a page in another collection?

No. A redirect always points to a page in the same collection.

#

Can my agent change my live docs without asking?

No. The agent shows you what it will create, change or publish and waits for your OK. Every edit is saved as a draft, and nothing reaches your live docs until it's published.

#

Get started free

Stop losing readers to "not found" pages. Connect your AI agent to DocStar, ask it to check your links, and publish the fixes in minutes.

Get started free

broken linksfix broken links in documentationredirectsdocs SEOAI agentsMCP