30 days free. No credit card. Full access from the moment you connect your site.

Start free trial

Update Rank Math Redirection

rank-math/update-redirection edits an existing redirection in place, keeping its ID, hit count and creation date.

Supply only the fields you want to change.

At a glance

Abilityrank-math/update-redirection
ToolsetRank Math — toolset/rank-math
GroupRank Math › Redirections & 404s
RequiresRank Math SEO, active on the site
Capabilitymanage_options
SafetyWrites data
RepeatableIdempotent — running it twice leaves the same result
Ships inAcrossAI Abilities Manager 0.0.34 and later

What delete-and-recreate loses

The obvious way to change a redirection is to delete it and make a new one. That works, and it discards the hit count and the creation date along the way.

Those are the two fields that make a redirection table maintainable. The hit count is how you tell a rule that is doing work from one that has been dead for two years; the creation date is how you tell which migration a rule belongs to. Reset them and the whole table becomes undifferentiated.

On a site with a few hundred rules accumulated over years, that history is the only thing standing between a cleanup and guesswork.

Rank Math checks whether a source would resolve to its own destination, because a redirection that points at itself is an infinite loop and the browser gives up with an error rather than a page.

A change that would create one is refused outright here rather than saved inactive — because unlike a creation, an update that silently deactivates an existing working rule takes something away.

Idempotent.

Input

NameTypeRequiredWhat it is
idintegerYesThe redirection ID.
sourcesarrayNoReplace the source rules.
destinationstringNoChange the destination.
status_codeintegerNoChange the HTTP status.
statusstringNoChange the active state.

What comes back

NameTypeWhat it is
redirectionobjectThe rule after the edit.
successbooleanWhether the call completed.
messagestringA one-line summary of what happened, suitable for showing a human.
error_codestringPresent only on failure — a stable machine-readable reason, such as a missing field, a wrong field type or an unmet confirmation.

Example

Ask your assistant:

Point the /old-pricing redirect at the new plans page instead.

It resolves to one call:

{
  "ability": "rank-math/update-redirection",
  "parameters": {
    "id": 44,
    "destination": "/plans"
  }
}

Worth knowing

  • Preserves the hit count and creation date. Delete-and-recreate does not.
  • A change that would create a loop is refused, and nothing is saved.
  • Partial — unsent fields are untouched.
  • Idempotent.

Related abilities


Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager

Browse the rest: Every ability, by category


Keep reading