Duplicate a post

ContentBeginner~5 min

Before you start

A connected site with content reads and content writes enabled so the agent can read a post and create a new draft.

Sometimes the fastest way to write a new post is to start from one you already have: a case study that follows a template, a weekly roundup, an announcement shaped like the last one. Copying it by hand means selecting the whole body, pasting it into a new post, and hoping you did not miss a block. People install a whole plugin just for this.

This copies the post into a fresh draft in one step, and never touches the original.

The prompt
Copy the post at [/case-studies/acme/] into a new draft I can adapt. Read the
original, then create a new draft with the same body and excerpt and a title
that makes clear it is a copy, like "[Copy] Acme case study". Leave the
original post exactly as it is, and keep the copy as an unpublished draft.
When you are done, give me the new draft's id and its edit link so I can open
it and start editing.

Why this is safe to run

The original is only read, never written, so duplicating a post cannot change or unpublish the thing you copied from. The one write creates a brand new draft, and a draft is private until you choose to publish it, so nothing goes live by accident.

The create ability is off until you enable it, the call is checked against the capability of the user you bound the agent to, and it lands in the Activity Log with the new draft’s id. If you decide you do not want the copy after all, it is a draft, so trashing it removes it cleanly.

Already connected? Skip the paste. Ask your agent for the “duplicate a post” recipe, name the post, and it makes the copy as a draft on your own site.

How it works

  1. Read the post you name, title, body, and excerpt.
  2. Create a new draft that copies the content, with a title that marks it as a copy.
  3. Leave the original completely untouched.
  4. Return the new draft's id and edit link so you can open it.

Questions

Does this change the original post?
No. The original is only read. Everything is written into a brand new draft, so the post you copied from is left exactly as it was.
Is the copy published?
No. It is created as a draft, so it stays private until you edit it and choose to publish. That is the point: you get a starting point to adapt, not a live duplicate.