Skip to content

Duplicate post multiple times

POST
/wp-json/wp2/post-duplicator/v1/posts/{post_id}/duplicate-batch
curl --request POST \
--url https://example.com/wp-json/wp2/post-duplicator/v1/posts/1/duplicate-batch \
--header 'Content-Type: application/json' \
--header 'X-WP-Nonce: <X-WP-Nonce>' \
--data '{ "titles": [ "example" ] }'

Synchronously creates several copies of the post from the titles array. Empty titles returns 400. Response 201 lists the new IDs.

post_id
required
integer

WordPress post ID.

Media typeapplication/json
object
titles
required

Titles of post copies for batch duplication.

Array<string>
replace_ids

Rewrite internal IDs in copy content. Default true.

boolean
default: true
Example
{
"titles": [
"example"
]
}
Media typeapplication/json
Array<object>
object
post_id

WordPress post ID.

integer
title

Title.

string
edit_link

Field “edit_link” as returned or accepted by PHP.

string
Examplegenerated
[
{
"post_id": 1,
"title": "example",
"edit_link": "example"
}
]

Not authenticated. WordPress REST: rest_not_logged_in / rest_forbidden. Use cookie + X-WP-Nonce or Application Password.

Media typeapplication/json
object
code

Machine-readable error or event code.

string
message

Message text (log, PIN, or password reset).

string
data

Extra WP_Error or license payload.

object
Examplegenerated
{
"code": "example",
"message": "example",
"data": {}
}

Insufficient capability or invalid REST nonce. WordPress REST: rest_forbidden / rest_cookie_invalid_nonce.

Media typeapplication/json
object
code

Machine-readable error or event code.

string
message

Message text (log, PIN, or password reset).

string
data

Extra WP_Error or license payload.

object
Examplegenerated
{
"code": "example",
"message": "example",
"data": {}
}