Migrate a link across your posts

ContentIntermediate~15 min

Before you start

A connected site with content reads and the replace-in-post write ability enabled.

You moved a page, and now the old URL is scattered across old posts that still point at the wrong place. Finding all of them by hand means searching, opening each post, and hoping you did not miss one. This does the finding for you and shows its work before it changes anything.

The prompt
I moved a page and need to fix the old link everywhere it still points to the
wrong place. Find every published post whose body still links to
[https://old-url.example/page] and swap it for [https://new-url.example/page].
Do it in two passes. First pass, change nothing: show me every post that has
the old link, with the post title and the sentence around it so I can see the
context. Stick to published posts only, leave drafts and pending alone, and
touch the post body only, nothing else on the post. After I approve the list,
do the replacements a few posts at a time, exact match only, and hand me back
the list of every post you changed.

Why this is safe to run

The first pass is a search, which writes nothing, so you approve the full list of matches before a single post is edited. The replace itself is the narrowest write the plugin has: it is a literal find-and-replace inside a post’s body, it never changes the post’s status, and it only runs on posts you can already edit. Every change is reversible through the post’s normal revision history, so a wrong guess about a match is something you undo from the editor, one post at a time, rather than a migration you have to unpick.

Already connected? Ask your agent for the “migrate a link across your posts” recipe and it runs the same find-then-approve-then-replace flow on your own content.

How it works

  1. Search published posts for the old URL.
  2. Show every match with the post title and the surrounding sentence.
  3. Wait for your approval on the list.
  4. Replace the old URL with the new one in the post body, exact match, in small batches.
  5. Return the list of every post it changed.

Questions

Does it touch drafts or pages?
No. It works on published posts only, and replace-in-post edits the post body, never the status. Pages are left alone.
Can I undo a bad replacement?
Yes. Each change is reversible through the post's normal WordPress revision history.