Contents
On this page
Update Address - Plugixa Permalink Manager
PUT /plugixa-permalink-manager/v1/uris/{kind}/{id}
Set an item’s custom address, give it back its default address, or change its update mode.
Needs the plugixa_permalink_manager_edit capability, and the WordPress permission to edit that post or term. POST and PATCH are accepted too.
Note. Only what you send changes: leave out
uriand the address stays, leave outmodeand the mode stays. A body with none ofuri,modeorresetchanges nothing and answers200withmeta.statusset tounchanged.
Request
PUT https://your-site.example/wp-json/plugixa-permalink-manager/v1/uris/post/36
Path parameters
| Name | Type | Description |
|---|---|---|
kind |
string |
post or term |
id |
integer |
The post or term id |
Request body
Content type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
uri |
string |
No | The new address. It is cleaned the way a typed slug is: lowercased, accents removed unless the settings keep them, spaces and punctuation turned into -, outer slashes, query string and fragment dropped. A full URL on this site is reduced to its path. An empty string resets the item to its default address. |
mode |
integer |
No | 0 follow the global setting, -1 keep, -2 keep and skip bulk tools, 1 update on save, 2 no custom permalink. See Update modes. |
reset |
boolean |
No | true gives the item the address its pattern produces, replacing whatever it had. |
expected_modified_at |
string |
No | The modified_at you read. If the stored address changed since, the save is refused with 409 instead of overwriting it. |
mode: 2wins over anything sent with it: the custom address is removed and the item goes back to its WordPress address.- Setting a
urion an item in mode2switches it back to0. - Choosing
-2,-1or1for an item that has no stored address gives it its default address first. - When the address changes, the old one keeps working as a redirect to the new one, and the change is written to the history.
- An address that is already taken is refused, never suffixed: the error carries a free
suggestion. A reset takes the nearest free address instead.
Note. A reset is not checked against the exclusions. A typed
urion an excluded item, or on the front page, is refused withplugixa_permalink_manager_not_managed, butreset: true(or an emptyuri) on the same item stores its default address.
Note.
expected_modified_atis compared as text, character for character. Send back exactly themodified_atyou read. An item with no stored address hasmodified_at: null: sendnullor leave the field out, because any string is then refused as stale.
{
"uri": "shop/tents/skyline-2",
"mode": -1,
"expected_modified_at": "2026-11-12 09:30:00"
}
Responses
200 OK. data is the item after the change.
{
"success": true,
"data": {
"kind": "post",
"id": 36,
"key": "post:36",
"type": "product",
"title": "Skyline 2 Tent",
"slug": "skyline-2",
"status": "publish",
"uri": "shop/tents/skyline-2",
"native_uri": "product/skyline-2",
"is_custom": true,
"mode": -1,
"source": "manual",
"lock": null,
"permalink": "https://your-site.example/shop/tents/skyline-2/",
"edit_url": "https://your-site.example/wp-admin/post.php?post=36&action=edit",
"redirects_count": 1,
"modified_at": "2026-11-12 10:15:00"
},
"meta": {
"status": "saved"
}
}
| Field | Type | Meaning |
|---|---|---|
data |
object |
The item, in the shape of Get Address |
meta.status |
string |
saved, or unchanged when the address and mode are what they already were |
Errors
| Status | Code | When |
|---|---|---|
404 |
plugixa_permalink_manager_not_found |
No post or term with that id. |
401 / 403 |
plugixa_permalink_manager_forbidden |
You may not edit this post or term in WordPress. |
409 |
plugixa_permalink_manager_uri_conflict |
Another item already uses the address. data.owner names it (kind, id, title, edit_url) and data.suggestion is a free address. |
409 |
plugixa_permalink_manager_stale |
The stored address changed since the expected_modified_at you sent. |
422 |
plugixa_permalink_manager_not_managed |
The item cannot have a custom address: its content type is turned off, it is excluded in the settings, or it is the front page. |
422 |
plugixa_permalink_manager_reserved_uri |
The address starts with a name WordPress needs, such as wp-admin, wp-json or wp-sitemap. |
422 |
plugixa_permalink_manager_invalid_uri |
The address contains a . or .. segment. |
422 |
plugixa_permalink_manager_empty_uri |
Nothing is left of the address once it is cleaned. |
422 |
plugixa_permalink_manager_uri_too_long |
The cleaned address is longer than 2,000 characters. |
422 |
plugixa_permalink_manager_invalid_mode |
mode is not one of -2 to 2. |
Plus the errors every endpoint can return.
Examples
curl -s -X PUT "https://your-site.example/wp-json/plugixa-permalink-manager/v1/uris/post/36" \
-u "admin:$WP_APP_PASSWORD" \
-H "Content-Type: application/json" \
-d '{"uri":"shop/tents/skyline-2","mode":-1,"expected_modified_at":"2026-11-12 09:30:00"}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-permalink-manager/v1/uris/post/36');
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([
'uri' => 'shop/tents/skyline-2',
'mode' => -1,
'expected_modified_at' => '2026-11-12 09:30:00',
]),
]);
$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/uris/post/36', {
method: 'PUT',
headers: {
'Authorization': auth,
'Content-Type': 'application/json',
},
body: JSON.stringify({
uri: 'shop/tents/skyline-2',
mode: -1,
expected_modified_at: '2026-11-12 09:30:00',
}),
});
const { data } = await response.json();
Quick Links
Share