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.Parameters
Page number. Defaults to
1.Results per page. Defaults to
50, maximum 200.Filter results to redirects whose source or target contains this string.
Response
Total number of redirects.
Current page number.
Results per page.
Total number of pages.
POST /redirects
Creates a new redirect rule. The source path is automatically normalised to start with/.
Parameters
The URL path to redirect from (e.g.
/old-page). Must be unique — duplicate sources return 409.The destination URL or path. Relative paths are converted to absolute using the site’s home URL at runtime.
HTTP redirect status code. Must be
301, 302, or 307. Defaults to 301.Response
Returns HTTP201 on success.
Always
true.The newly created redirect object with all fields.
PUT /redirects/
Updates an existing redirect.Parameters
Updated source path.
Updated destination URL or path.
Updated HTTP code:
301, 302, or 307.Response
Always
true.The updated redirect object with all fields.
DELETE /redirects/
Permanently deletes a redirect rule.Response
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.Response
Always
true.A time-limited URL to download the CSV file. Expires after 120 seconds.
GET /redirects/download
Streams the exported CSV file generated byPOST /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.Parameters
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.Parameters
A CSV file with columns:
Source, Target, Type (HTTP code). The Type column defaults to 301 if omitted or invalid.Response
Always
true.Number of redirects successfully imported.
