Draft Then Publish Post
A 3-step recipe with WordPress. We can help you get access.
Recipe · 3 steps
Draft Then Publish Post
with WordPress
Create a draft post, update it, and publish it.
- Create the post in draft status so it is saved but not yet visible to the public. WordPress returns 201 with the new post id.
- Patch the draft with the finalized title and content and flip its status to publish in a single update.
- Read the post back by id to confirm it is now published.
What you'll need to have ready
- authorization: HTTP Basic Authorization header value built from a WordPress Application Password (e.g. "Basic dXNlcjpwYXNzd29yZA==").
- draftTitle: The working title used while the post is in draft.
- finalTitle: The finalized title to publish under.
- finalContent: The finalized HTML content body to publish.
For your developer
Arazzo workflow wordpress:draft-then-publish-post, 3 operations: createPost → updatePost → getPost. Specs on APIs.io.