Contents
On this page

Bulk Delete Redirects - Plugixa Permalink Manager

POST /plugixa-permalink-manager/v1/redirects/bulk-delete

Delete up to 500 redirects of any kind in one request.

Needs Plugixa Permalink Manager Pro and the plugixa_permalink_manager_redirects capability.

Request

POST https://your-site.example/wp-json/plugixa-permalink-manager/v1/redirects/bulk-delete

Request body

Content type: application/json

Field Type Required Description
ids array Yes 1 to 500 redirect ids. Ids that do not exist are ignored.
{
  "ids": [
    112,
    113,
    120
  ]
}

Responses

200 OK.

{
  "success": true,
  "data": {
    "deleted": 3
  }
}
Field Type Meaning
data.deleted integer How many redirects were actually deleted

Errors

Status Code When
400 plugixa_permalink_manager_invalid ids is missing, empty, not a list, or longer than 500.

Plus the errors every endpoint can return.

Examples

curl -s -X POST "https://your-site.example/wp-json/plugixa-permalink-manager/v1/redirects/bulk-delete" \
  -u "admin:$WP_APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{"ids":[112,113,120]}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-permalink-manager/v1/redirects/bulk-delete');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST  => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERPWD        => 'admin:' . getenv('WP_APP_PASSWORD'),
    CURLOPT_HTTPHEADER     => ['Content-Type: application/json'],
    CURLOPT_POSTFIELDS     => json_encode([
        'ids' => [112, 113, 120],
    ]),
]);
$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/bulk-delete', {
  method: 'POST',
  headers: {
    'Authorization': auth,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    ids: [112, 113, 120],
  }),
});
const { data } = await response.json();

Quick Links

Share