Skip to main content
All redirect endpoints are available since v1.4.0.

GET /redirects

Returns a paginated list of redirects. Supports full-text search on source and target URLs.
curl -X GET "https://example.com/wp-json/wp-manager-pro/v1/redirects?page=1&per_page=50" \
  -H "X-WP-Nonce: YOUR_NONCE"

Parameters

page
integer
Page number. Defaults to 1.
per_page
integer
Results per page. Defaults to 50, maximum 200.
Filter results to redirects whose source or target contains this string.

Response

redirects
array
total
integer
Total number of redirects.
page
integer
Current page number.
per_page
integer
Results per page.
total_pages
integer
Total number of pages.

POST /redirects

Creates a new redirect rule. The source path is automatically normalised to start with /.
curl -X POST https://example.com/wp-json/wp-manager-pro/v1/redirects \
  -H "X-WP-Nonce: YOUR_NONCE" \
  -H "Content-Type: application/json" \
  -d '{"source": "/old-page", "target": "/new-page", "type": 301}'

Parameters

source
string
required
The URL path to redirect from (e.g. /old-page). Must be unique — duplicate sources return 409.
target
string
required
The destination URL or path. Relative paths are converted to absolute using the site’s home URL at runtime.
type
integer
HTTP redirect status code. Must be 301, 302, or 307. Defaults to 301.

Response

Returns HTTP 201 on success.
success
boolean
Always true.
redirect
object
The newly created redirect object with all fields.

PUT /redirects/

Updates an existing redirect.
curl -X PUT https://example.com/wp-json/wp-manager-pro/v1/redirects/12 \
  -H "X-WP-Nonce: YOUR_NONCE" \
  -H "Content-Type: application/json" \
  -d '{"target": "/updated-destination", "type": 302}'

Parameters

source
string
Updated source path.
target
string
Updated destination URL or path.
type
integer
Updated HTTP code: 301, 302, or 307.

Response

success
boolean
Always true.
redirect
object
The updated redirect object with all fields.

DELETE /redirects/

Permanently deletes a redirect rule.
curl -X DELETE https://example.com/wp-json/wp-manager-pro/v1/redirects/12 \
  -H "X-WP-Nonce: YOUR_NONCE"

Response

success
boolean
Always true on success.

POST /redirects/export

Exports all redirects as a CSV file and stores the result in a short-lived transient (120 seconds). Returns a signed download URL.
curl -X POST https://example.com/wp-json/wp-manager-pro/v1/redirects/export \
  -H "X-WP-Nonce: YOUR_NONCE"

Response

success
boolean
Always true.
download_url
string
A time-limited URL to download the CSV file. Expires after 120 seconds.

GET /redirects/download

Streams the exported CSV file generated by POST /redirects/export. The response is a CSV file download, not JSON.
Use the download_url from POST /redirects/export directly — it includes the required key and _wpnonce query parameters.
curl -o redirects.csv "https://example.com/wp-json/wp-manager-pro/v1/redirects/download?key=KEY&_wpnonce=NONCE"

Parameters

key
string
required
The one-time download key returned by POST /redirects/export.

POST /redirects/import

Imports redirects from an uploaded CSV file. The first row is treated as a header and skipped automatically. Duplicate source paths are silently ignored.
curl -X POST https://example.com/wp-json/wp-manager-pro/v1/redirects/import \
  -H "X-WP-Nonce: YOUR_NONCE" \
  -F "[email protected]"

Parameters

file
file
required
A CSV file with columns: Source, Target, Type (HTTP code). The Type column defaults to 301 if omitted or invalid.

Response

success
boolean
Always true.
imported
integer
Number of redirects successfully imported.

Build docs developers (and LLMs) love