Redirect Moved or Renamed Pages with 404 to 301 with AI
Point the old addresses of moved or renamed pages at their new home with tested 301 redirects.
Prerequisites
A site connected to WPVibe running the free 404 to 301 plugin, 4.0.5 or newer (tested on 4.0.5), on WordPress 6.9 or newer, with an administrator account.
My site uses the 404 to 301 plugin. I moved or renamed some pages. Redirect each old address to its new page, with my yes first: - [old address 1] now lives at [new address or page title 1] - [old address 2] now lives at [new address or page title 2] 1. Run discover_abilities with category 404-to-301-redirects. If it finds nothing, stop and tell me to install or update the free 404 to 301 plugin (4.0.5 or newer) on WordPress 6.9 or newer. 2. Write each old address as a path from the first slash, without my domain, and call it OLD_PATH. To see whether a published page or post lives at an address, take the last part of its path as the slug and run rest_api GET /wp/v2/pages and GET /wp/v2/posts with slug set to it: it lives there if a result's link ends with that path. If a published page still lives at OLD_PATH, tell me a redirect would send visitors away from that live page, and leave that pair out unless I say otherwise. 3. Find each new page: for a title, run rest_api GET /wp/v2/search with search set to the title; for an address on my site, use its last part as the slug in /wp/v2/pages and /wp/v2/posts. Use only a published page or post that clearly matches, and call its id NEW_ID. If the new address is on another site, keep it as NEW_URL. If you can't find it, ask me. 4. Run 404-to-301/redirect-test with url OLD_PATH. If outcome is rule, a redirect catches it already: show me where it goes, its redirect id and its match_type. If match_type is prefix or regex, the rule covers other addresses too: leave it alone and say a new exact rule for OLD_PATH takes precedence over it in step 6. If match_type is exact, ask whether to repoint it instead of adding one (404-to-301/redirect-update with that redirectId, target_type page and target_page_id NEW_ID, or target_type link and target_url NEW_URL, plus redirect_type 301 if it is a temporary 302, 303 or 307 and the move is for good). Then run 404-to-301/redirect-test with the new page's path: outcome fallback or none only means no rule catches it, and the page shows as normal; if outcome is rule, the new address is redirected too, which would chain two redirects, so tell me and use the final page instead. 5. Show me a table: old address, new page (title and url), what the old address does today. Wait for my yes. 6. On my yes, for each pair run 404-to-301/redirect-create with source OLD_PATH, target_type page and target_page_id NEW_ID (or target_type link and target_url NEW_URL for another site), redirect_type 301 and notes Moved on TODAY (today's date in YYYY-MM-DD). If one returns rest_duplicate_source, a rule for OLD_PATH exists but may be switched off: show me rule existing_id with 404-to-301/redirects-list (search set to OLD_PATH) and ask whether to repoint it and switch it on with 404-to-301/redirect-update (that redirectId, target_type page and target_page_id NEW_ID, or target_type link and target_url NEW_URL, redirect_type 301, is_active true). If one returns another error, show it to me and go on with the rest. 7. For each, run 404-to-301/redirect-test with OLD_PATH and check that outcome is rule, status_code is 301 and destination is the new page's url. Show me the list. Ask me to open one old address in a private window. To undo one, run 404-to-301/redirect-update with its redirectId and is_active false.
Skip pasting the full prompt. Drop this into your AI on a site that already has WPVibe:
Run the “Redirect Moved or Renamed Pages with 404 to 301 with AI” recipe from the WPVibe cookbook on my connected site.
You renamed a page, merged two posts or moved a section, and the old addresses are still out there: in Google, in newsletters, in links on other sites. Each one now lands on a missing page, or on your homepage. Setting up the redirects means a plugin screen, careful copying and no way to tell whether each one works.
The AI checks each old address before touching anything: whether a page still lives there, whether a redirect exists already, and whether the new page is itself redirected, which would chain two hops. It finds the new page on your site, shows you the plan, and after your yes points each old address at the page itself, then tests every one.
List each old address with its new page, by address or by title. Each redirect follows its page if that page’s address changes later, and you can switch one off any time. To check all your redirects later for chains and dead ends, use this recipe.
Outcome
Each old address sends visitors to its new page with a 301, checked for chains first and tested after.