Find and fix broken links in your content

SEOIntermediate~30 min

Before you start

A connected site with content reads on and the content write ability enabled. Take a database backup before a large run. 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 them with a
literal find-and-replace on the exact link, work in small batches, and show me
each batch 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 a literal find-and-replace on the exact link string, which edits the post body only and never touches status. The content write ability 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. Edits go through revisions, so any fix you want to undo is one restore away. 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 the approved fixes with a literal find-and-replace, 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.