Contents
On this page

Delete Permastructure - Plugixa Permalink Manager

DELETE /plugixa-permalink-manager/v1/permastructures/{kind}/{name}

Remove the pattern of one post type or taxonomy, so new items get their WordPress address again. Existing addresses stay where they are.

Needs the plugixa_permalink_manager_manage_settings capability.

With language, only that language’s own pattern is removed, and the language falls back to the shared one. Removing a pattern that is not stored still answers 200.

Request

DELETE https://your-site.example/wp-json/plugixa-permalink-manager/v1/permastructures/post_type/product

Path parameters

Name Type Description
kind string post_type or taxonomy
name string The post type or taxonomy name

Query parameters

Name Type Default Description
language string A language code on a multilingual site, to read or write that language’s own pattern. Empty for the pattern every language falls back to

Responses

200 OK. data is the content type after the change.

{
  "success": true,
  "data": {
    "kind": "post_type",
    "name": "product",
    "label": "Products",
    "language": "",
    "pattern": null,
    "append_slug": true,
    "inherited": null,
    "native": "product/skyline-2",
    "tags": [
      {
        "tag": "postname",
        "label": "Post name (full path for pages)",
        "group": "post"
      },
      {
        "tag": "product_cat",
        "label": "Categories (full path)",
        "group": "taxonomy"
      }
    ]
  }
}

Errors

Status Code When
404 plugixa_permalink_manager_not_found kind and name are not a managed content type.
422 plugixa_permalink_manager_invalid_language language is not one of the site’s languages.

Plus the errors every endpoint can return.

Examples

curl -s -X DELETE "https://your-site.example/wp-json/plugixa-permalink-manager/v1/permastructures/post_type/product" \
  -u "admin:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-permalink-manager/v1/permastructures/post_type/product');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST  => 'DELETE',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERPWD        => 'admin:' . getenv('WP_APP_PASSWORD'),
]);
$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/permastructures/post_type/product', {
  method: 'DELETE',
  headers: { 'Authorization': auth },
});
const { data } = await response.json();

Quick Links

Share