Duplicate Post


Copies an existing post as a new draft, including its Elementor layout, theme display settings, custom fields, SEO fields, categories, tags and featured image. Use this to create a post that matches the design of existing ones, then edit the copy. The duplicate is authored by the current user and is created as a draft unless another status is given.

Property Value
Ability slug mosmcp/post-duplicate
Wire tool name mosmcp__post-duplicate
Category Posts (mosmcp-posts)
Plan Free

 

Required access

Requirement Value
Capability edit_post (checked against the specific post)
Minimum default role Contributor
Annotations readOnly: false · destructive: false · idempotent: false · openWorld: false

 

Input schema

Field Type Required Default Description
source_id integer (min 1) Yes — The ID of the post to duplicate. Its layout and settings become the new post's.
title string — Title for the duplicate. Omit to use the original title followed by "(copy)".
status string (one of draft, pending, private, publish) draft Status for the duplicate. Defaults to draft so the result can be reviewed before publishing. Publishing requires the publish capability.
include_content boolean true Whether to copy the post body. Set false to keep the layout and settings but start with empty content. Defaults to true.
expected_modified string — Optional. The "modified" timestamp from a previous read of the source post. The duplicate is refused if the source changed since then.

 

Output schema

Field Type Required Description
new_id integer Yes ID of the newly created duplicate.
source_id integer Yes
title string Yes
status string Yes
edit_url string
view_url string
copied object
copied.meta_rows integer Number of metadata rows copied.
copied.taxonomies string[] Taxonomies whose terms were copied.
copied.thumbnail_id integer Featured image attachment ID on the duplicate, or 0.
copied.has_elementor boolean Whether the duplicate carries an Elementor layout.
copied.elementor_bytes integer
skipped object[] Metadata deliberately not copied, with the reason for each.
skipped[].key string
skipped[].reason string
rewritten object[] Metadata cleared rather than copied because the value is unique to the original.
rewritten[].key string
rewritten[].reason string
warnings object[] Non-fatal issues encountered while duplicating.
warnings[].code string
warnings[].message string
warnings[].context string

 

Example

Sample prompt
Make a copy of my 'Summer Sale' post as a draft so I can reuse its layout for the autumn sale.

Example request (json)

{
  "jsonrpc": "2.0",
  "id": 6,
  "method": "tools/call",
  "params": {
    "name": "mosmcp__post-duplicate",
    "arguments": {
      "input": {
        "source_id": 42,
        "title": "Autumn Sale"
      }
    }
  }
}

Example response (json)

{
  "jsonrpc": "2.0",
  "id": 6,
  "result": {
    "isError": false,
    "structuredContent": {
      "new_id": 87,
      "source_id": 42,
      "title": "Autumn Sale",
      "status": "draft",
      "edit_url": "https://example.com/wp-admin/post.php?post=87&action=edit",
      "view_url": "https://example.com/?p=87",
      "copied": {
        "meta_rows": 14,
        "taxonomies": [
          "category",
          "post_tag"
        ],
        "thumbnail_id": 311,
        "has_elementor": true,
        "elementor_bytes": 18422
      },
      "skipped": [
        {
          "key": "_edit_lock",
          "reason": "Editor session state; copying it would mark the new post as being edited."
        }
      ],
      "rewritten": [
        {
          "key": "_yoast_wpseo_canonical",
          "reason": "Canonical URL points at the original post."
        }
      ],
      "warnings": []
    }
  }
}

 

Edge cases / errors

  • source_id not a post, or the source is an unsaved auto-draft → refused (source_not_found / source_not_saved).
  • status of publish or private without the publish capability → refused with cannot_publish; create it as a draft instead.
  • expected_modified differs from the source's current modified time → refused with source_changed so you re-read before copying; an unparseable value → invalid_expected_modified.
  • If the copied Elementor layout comes out corrupted while the original was readable, the duplicate is force-deleted and elementor_copy_corrupted is returned; lesser issues (Elementor inactive, layout not in builder mode, CSS regen failure) come back as warnings.

 


<< Previous Next >>
Delete Post Permanently Find Post (ID by Name / Name by ID)

For more information about the Secure MCP Server for WordPress plugin, explore the following resources:

Product Overview | Pricing | Try for Free | Documentation

If you have any questions regarding plugin configuration, pricing plans or licensing, please contact us or mail us at aisupport@xecurify.com.