Contents
On this page
Update Redirect - Plugixa Permalink Manager
PUT /plugixa-permalink-manager/v1/redirects/{id}
Change a redirect’s status code, switch it on or off, or edit its note. For a manual redirect, also its source and target.
Needs Plugixa Permalink Manager Pro and the plugixa_permalink_manager_redirects capability. POST and PATCH are accepted too.
Only the fields you send change. An old address of an item (auto or alias) always leads to the item’s current address: it can be switched off, re-coded or deleted, but sending source or target for it is refused.
Request
PUT https://your-site.example/wp-json/plugixa-permalink-manager/v1/redirects/112
Path parameters
| Name | Type | Description |
|---|---|---|
id |
integer |
The redirect id |
Request body
Content type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
status_code |
integer |
No | 301, 302, 307 or 308. Any other value is saved as 301. |
is_enabled |
boolean |
No | false stops serving it without deleting it. |
note |
string |
No | Plain text. |
source |
string |
No | Manual redirects only. The same rules as Create Redirect. |
target |
string |
No | Manual redirects only. A target starting with / is a path on this site. Anything else must be a full http or https URL on an allowed host: this site, a host listed in external_redirect_hosts, or any host when external_redirect_policy is any. See Redirects settings. |
{
"status_code": 302,
"is_enabled": false,
"note": "Paused until the next sale"
}
Responses
200 OK. data is the redirect after the change.
{
"success": true,
"data": {
"id": 112,
"kind": "manual",
"source_uri": "summer-sale.html",
"target": {
"url": "https://your-site.example/shop/sale",
"title": null,
"edit_url": null
},
"status_code": 302,
"is_enabled": false,
"note": "Paused until the next sale",
"created_at": "2026-11-12 09:30:00"
}
}
| Field | Type | Meaning |
|---|---|---|
data |
object |
The redirect, in the shape of Create Redirect |
Errors
| Status | Code | When |
|---|---|---|
404 |
plugixa_permalink_manager_not_found |
No redirect with that id. |
422 |
plugixa_permalink_manager_redirect_fixed |
source or target sent for an old address of an item. |
409 |
plugixa_permalink_manager_redirect_exists |
Another redirect already leaves from the new source. |
409 |
plugixa_permalink_manager_source_live |
The source is the address of a page that exists, so the redirect would never be used. |
422 |
plugixa_permalink_manager_reserved_uri |
The source starts with a name WordPress needs, such as wp-admin. |
422 |
plugixa_permalink_manager_invalid_uri |
The source contains a . or .. segment. |
422 |
plugixa_permalink_manager_empty_uri |
The source is empty. |
422 |
plugixa_permalink_manager_uri_too_long |
The source is longer than 2,000 characters. |
422 |
plugixa_permalink_manager_invalid_target |
The target is empty. |
422 |
plugixa_permalink_manager_redirect_loop |
The target is the source. |
422 |
plugixa_permalink_manager_redirect_host |
The target is not a full http or https URL, contains forbidden characters, or its host is not allowed. |
500 |
plugixa_permalink_manager_db_error |
The redirect could not be saved. |
Plus the errors every endpoint can return.
Examples
curl -s -X PUT "https://your-site.example/wp-json/plugixa-permalink-manager/v1/redirects/112" \
-u "admin:$WP_APP_PASSWORD" \
-H "Content-Type: application/json" \
-d '{"status_code":302,"is_enabled":false,"note":"Paused until the next sale"}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-permalink-manager/v1/redirects/112');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_USERPWD => 'admin:' . getenv('WP_APP_PASSWORD'),
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'status_code' => 302,
'is_enabled' => false,
'note' => 'Paused until the next sale',
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const auth = 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`);
const response = await fetch('https://your-site.example/wp-json/plugixa-permalink-manager/v1/redirects/112', {
method: 'PUT',
headers: {
'Authorization': auth,
'Content-Type': 'application/json',
},
body: JSON.stringify({
status_code: 302,
is_enabled: false,
note: 'Paused until the next sale',
}),
});
const { data } = await response.json();
Quick Links
Share