Skip to main content
Glama

Duplicate a post or page

wp_duplicate_post

Copy an existing post or page into a new draft while the original stays unchanged. Use the copy as a starting point, with supported taxonomy terms and page builder layouts preserved when permitted.

Instructions

Copy an existing post or page into a new draft, as a starting point for a new page; the original stays unchanged and each call creates another copy. The draft gets the title with " (Copy)" appended, the content, excerpt, parent, menu order and the terms of taxonomies the account may assign (of those, the terms it may assign one by one, assign_term), and, for an account that may edit the original, its custom fields, featured image, page template and page builder layout, so a page built with Elementor, Beaver Builder, SiteOrigin or another builder that stores its layout in post meta stays a builder page. Page builder data holds markup and is copied only with the unfiltered_html capability; a builder's keys, its page template included, are copied together or not at all; Elementor element ids are renewed. Never copied: credential-like keys, the original's editing state (edit lock, last editor, former slugs, trash data), caches the builder rebuilds, protected keys of other plugins, and a revision's meta. Media files cannot be duplicated, and a password-protected post only by an account that may edit it. Returns {duplicated: true, new_id}, the copied and skipped keys (with reasons) and the original's builder. Needs the right to read the original and to create entries of its type.

Input Schema

NameRequiredDescriptionDefault
idYesId of the post or page to copy.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv4.7.0

TDQS

A4.3/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations only say this is a non-idempotent, non-destructive write; the description adds substantial context beyond that: which fields are copied, which are never copied (credentials, edit lock, former slugs, caches, other plugins' protected keys), capability gating (unfiltered_html for builder markup), builder key atomicity, Elementor id renewal, and password-protection rules. It also discloses the return shape, which no output schema provides.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose is front-loaded correctly, but the body is a single dense run-on cramming taxonomy terms, builder behavior, capability gating, exclusions, and return shape into one sentence chain. The content mostly earns its place, but scanning it for the relevant clause is hard.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a one-parameter tool with no output schema, the description covers permissions, exactly what will and will not be carried over, edge cases (media, password-protected posts, revisions), and the return payload. An agent has everything needed to call it correctly and predict the outcome.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The single `id` parameter is fully described in the schema (100% coverage), so the baseline is 3. The description adds only that the caller needs read rights on the original and the ability to create entries of its type, which is permission context rather than parameter meaning.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource: copy an existing post or page into a new draft, with the original unchanged. It distinguishes the operation from wp_create_post or wp_get_post by making clear it produces a new draft derived from an existing entry, not a fresh record or a read.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It states the intended scenario (a starting point for a new page) and the key behavioral premise that each call creates another copy while the original is untouched. It does not name siblings such as wp_create_post or say when not to use it, so there is no explicit alternative routing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools