REST API Support

Permalink Manager offers REST API support through a separate addon, allowing to manage custom permalinks programmatically via WordPress built-in endpoints.

The addon extends the REST API by registering a new custom_permalink field for all post types and taxonomies supported by Permalink Manager. This dedicated field allows you to get or set custom permalinks using API queries:

  • GET requests:
    Retrieve the current custom URI
  • POST/PUT requests:
    Set or update the custom URI
The extension is compatible with both the (free) Lite and the (paid) Pro versions of Permalink Manager.

Using the Addon

Download & Install

The addon is available for a one-time fee through Lemonsqueezy marketplace, which supports payments by credit card and PayPal. After completing your purchase, you will receive an email with the confirmation and download link.

The addon starts working automatically after activation, as long as Permalink Manager Lite or Pro is also active.

When making a GET request to retrieve a post, the addon automatically registers the new schema field for all supported post types and taxonomies.

To get the custom permalink, look for the custom_permalink field in the JSON response when you request all items or a single item using its ID.

GET: https://example.com/wp-json/wp/v2/posts/<POST_ID>
GET: https://example.com/wp-json/wp/v2/posts
{
...
"custom_permalink": "wroclaw\/poland\/jan-kowalski",
...
}

The same custom_permalink field can be used to set or update custom permalinks through the WordPress REST API. To set the permalink, simply use this field in your request body when creating (POST) or updating (POST/PUT) content.

POST/PUT: https://example.com/wp-json/wp/v2/posts/<POST_ID>
{
"status": "publish",
"title": "Porsche Macan",
"content": "Lorem ipsum dolor sit amet.",
"custom_permalink": "a-sample-permalink/for-new-post"
}

If the field is present in the request but left empty, Permalink Manager will automatically generate a default custom permalink.

This new permalink is based on the current Permastructure settings for the content type, regardless of whether you are creating or updating the record.

POST/PUT: https://example.com/wp-json/wp/v2/posts/<POST_ID>
{
"custom_permalink": ""
}

FAQ

Do I need authentication to use the REST API endpoints?

Yes, updating custom URIs requires appropriate authentication and capabilities (typically editor or administrator roles).

Can I bulk update custom URIs through the REST API?

Currently, URIs must be updated individually through separate API requests.

Go up