Audit redirects and test URLs before a migration

SEOIntermediate~10 min

Before you start

Plugin version 1.13.0 or newer, and at least one of Redirection, Rank Math, Safe Redirect Manager, 301 Redirects or Slim SEO storing your redirects. Enable List redirects, Get a redirect and Test a URL against the redirects on the Abilities tab; they start off and need a user who can manage options. All three are reads.

A migration is where redirects quietly break. Old rules pile up, a few point at pages that moved twice, and one forms a loop nobody notices until rankings drop. Catching that after the move means crawling the live site. Before the move, you can just ask.

This prompt reads every redirect your redirect plugins store, then checks the addresses you care about against them. Nothing is requested and nothing changes.

The prompt
I am about to [move this site to a new domain / restructure the blog] and want
to know the redirects are sound first. Only read.
List every stored redirect from each supported redirect plugin: source, target,
status code, whether it is on, and hits where the plugin keeps them. Group them
by plugin. Flag disabled redirects, pattern or regex redirects, and targets
that leave the site. Tell me if any plugin's list was cut short.
Then test each of these addresses against the redirects, without requesting
them: [/old-pricing/, /blog/2019/launch/, /shop/]. For each, tell me which
redirect it hits, where it ends after following the chain, and whether it
leaves the site or loops. Read any redirect you want to explain in detail.
Finish with a short list of what the test could not see, such as server rules
or plugins it does not support, so I know what to check by hand.

Why this is safe to run

All three tools are reads. Listing and reading redirects changes nothing, and the test is a simulation: it never requests the address and never touches a hit counter or a log. Query strings and sign-in details are removed from targets, and the result says when that happened. A plugin holding more than 5,000 redirects is read up to the first 5,000, and the result says so.

The test has limits it states. Conditional and pattern redirects are checked by each plugin’s own matcher where it has one and are otherwise unknown, and settings such as a 404 fallback or attachment redirects are named as the match instead of a rule id. When more than one redirect plugin is active, reading one redirect needs the plugin named. To find addresses that already 404, use find not-found addresses worth redirecting.

Already connected? Ask your agent for the “audit redirects and test URLs before a migration” recipe, or just give it the addresses you are worried about.

How it works

  1. List the stored redirects from each supported plugin, with status code, whether each is on, and hit counts where the plugin keeps them.
  2. Flag disabled redirects, pattern redirects and targets that point off the site.
  3. Test each address you care about against the stored redirects without requesting it.
  4. Report where each address ends, and any chain, loop or exit from the site.
  5. List what the test cannot see, so you know what to check by hand.

Questions

Does testing a URL count as a visit or change hit counters?
No. The test works out which stored redirect an address would hit without requesting it and without touching any hit counter or log. It follows the redirects it can see for up to ten steps.
Is the test answer complete?
Never quite. It does not see server rules, WordPress's own redirects, a CDN or redirect plugins it does not support, and it names those when it finds them. When it cannot be sure, a plugin answers unknown with a hint to request the address without following redirects, which is the only sure check.