Redirect Toolswordpress_delete_redirect

wordpress_delete_redirect

Delete a redirect by id or exact source. The answer carries what recreates it, and a snapshot puts it back.

wordpress_delete_redirect

Delete a redirect, by id from wordpress_list_redirects or by its exact source. Only redirects in Redirection or Respira's own list can be deleted.

To stop a redirect for a while, use wordpress_update_redirect with enabled: false instead.

Parameters

NameTypeRequiredWhat it is
idstringone of id, sourceThe id from the list, such as respira:3 or redirection:17.
sourcestringone of id, sourceThe exact source, when there is no id.
regexbooleannoWhether that source is a pattern.
dry_runbooleannoShow what would be deleted and write nothing.

Example call

{
  "name": "wordpress_delete_redirect",
  "arguments": { "id": "respira:3" }
}

Response

{
  "success": true,
  "deleted": true,
  "redirect": { "id": "respira:3", "source": "/old-page", "target": "https://new-domain.example/page/", "status_code": 301 },
  "recreate_with": {
    "tool": "respira_create_redirect",
    "arguments": { "source": "/old-page", "target": "https://new-domain.example/page/", "status_code": 301, "regex": false, "query": "ignore", "engine": "respira" }
  },
  "recovery_snapshot_uuid": "…",
  "restore_with": "respira_restore_snapshot"
}

wordpress_restore_snapshot with recovery_snapshot_uuid puts the redirect back. A redirect that lived in Redirection comes back as a new Redirection item with a new id, and the restore says which.

Availability

Plugin 9.2.0.

Example Prompts

  • "Delete the redirect from /old-promo, it is not needed any more."