Defining a URL via REST API – is it possible?

[ad_1]

Hello WordPress folks,

I create articles in WP via REST API. Title, content and custom fields are transmitted via the API. This results in a URL in WP, e.g. for the title ‘Example title’ the URL mydomain.xyz/category/example-title.

If I submit a second article with the same title, it gets the URL mydomain.xyz/category/example-title-2.

With the help of the ‘Custom Post Type Permalinks’ plugin, the permalink is then supplemented with content from the custom fields. This way I (actually) get a consistent and unique URL.

How can I ensure that the number (-2) is not added to titles with the same name? Is there a way to transmit the desired URL directly via API to prevent consecutive numbering for titles with the same name?

Thanks for your help!

[ad_2]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer