LearningSpot@Wordpress icon

LearningSpot@Wordpress

Consume Wordpress API

Post → Update

AI-generated

Summary

Update an existing WordPress post by specifying its post ID and optionally modifying its fields and featured media.

Inputs

  • Post ID (required) — Unique identifier of the post to update.
  • Update Fields — Optional fields to update, including author ID, title, content, slug, password, status (draft, future, pending, private, publish), comment status (open or closed), ping status, format (e.g. aside, audio, gallery), sticky flag, featured media ID, categories, tags, and post template settings.
  • Featured Media — Boolean flag to upload new featured media for the post.
  • Binary Property (required) — Specifies which binary property contains the media to upload, required if uploading featured media.
  • File Name — The filename with extension for the media to upload, e.g., example.jpeg.

Output shape

a single updated post record as JSON

Returns the updated post object including a featuredMediaId field if new media was uploaded.

Examples

Example 1: Update a post's title and content

Set 'Post ID' to target post, provide 'Update Fields' with new 'title' and 'content'. Do not toggle 'Featured Media'. Returns updated post.

Example 2: Update a post including uploading featured media

Set 'Post ID', toggle 'Featured Media' to true, specify 'Binary Property' with media binary data input, set 'File Name' for the media file, and optionally update fields like title or status. The media will be uploaded and associated as the post's featured media.

Links

Discussion