Find and fix broken links in your content

SEOIntermediate~30 minUpdated

Before you start

A connected site with content reads on and Replace block enabled. Checking whether a destination is dead needs web access in your AI client, since the plugin has no tool for that. Pages are reached only while the Update page tool is on. Posts owned by a page builder are refused. Take a database backup before a large run. Each edit is also recorded in the Changes tab, which can revert it provided the post stays as the edit left it. This covers links written inside post and page content only.

Broken links pile up on their own. A site you linked to goes down, a page you referenced moves, a product gets discontinued, and the link just sits there returning a 404 to every reader who clicks it. Search engines notice, readers bounce, and you never find out until someone emails you.

This puts the tedious part, reading every post and checking every URL, on the agent, and keeps the fixing decisions with you. It is honest about its reach: it works on links written inside your content. Links baked into your theme, your widgets, or your navigation menu, and anything a redirect plugin handles, are outside what these abilities can see, so it will not pretend to have checked them.

The prompt
I want to find and fix broken links in [my blog posts from the last two years].
I have content writes turned on. Only look at links inside the post content.
First pass, change nothing. List those posts, read them, pull out every link,
and check which destinations are dead or redirecting. Then give me a table:
the post, the broken link, and your proposed fix, either the corrected URL or
removing the link and keeping the text where there is no good replacement.
Never guess a URL; if you are not sure, mark it for me to decide.
I will tell you which fixes to keep. Only after I approve, apply each one by
reading the post as raw block markup and replacing only the block that holds
the link, sending exactly one block and passing its path and its block name as
the expected block name. Keep the rest of the block's text as it was. If a post
has classic content with no blocks, list it as skipped. Work in
small batches and show me each batch with the old block markup beside the new
one before it saves. Do not touch post status. At the end, list every post
you edited and every link you left unresolved.

Why this is safe to run

The whole diagnostic pass is reads. Listing the posts, reading them, and extracting the links writes nothing, so you see every broken link and its proposed fix as a table before a single save.

The write half is Replace block, one call per block that holds a link. Replace block checks the block name at that path before it writes. Replace block stays off until you enable it, every call is checked against the capability of the user you bound the agent to, and every edit lands in the Activity Log with the post it changed. The old block markup is in each batch, so a fix you want to undo can be put back. For anything older or already edited again, the Changes tab refuses the revert rather than overwrite a newer edit. And because the scope is content links only, the agent will tell you plainly what it could not check rather than imply full coverage.

Already connected? Skip the paste. Ask your agent for the “find and fix broken links” recipe, or just point it at a set of posts, and it runs the same check-then-approve flow on your own site.

How it works

  1. List the posts or pages you name and read the content of each.
  2. Extract every link and check which destinations are dead or redirecting.
  3. Propose a fix per broken link: the correct URL, or removing the link if there is no replacement, and wait for your approval.
  4. Apply each approved fix by replacing the one block that holds the link, in small batches, pausing to show each batch.
  5. Return the list of every post it edited and every link left unresolved.

Questions

Does this catch every broken link on my site?
No, and it is honest about that. It reads links written inside your post and page content. It cannot see links hardcoded in your theme, in widgets, or in a menu, and it does not manage redirects. For content links it is thorough; for those other places you still need to check by hand or with a dedicated tool.
What happens to a link it cannot find a replacement for?
It never guesses. If there is no clear correct URL, it proposes either removing the link and keeping the text, or leaving it for you to decide, and it lists every unresolved link at the end so nothing is silently dropped.