WordPress - Update Post
Description
Section titled “Description”This module allows updating existing posts or articles in WordPress. Only the specified fields are modified, leaving the rest unchanged. Supports changing title, content, status, categories, and featured image.
Configuration
Section titled “Configuration”Credentials
Section titled “Credentials”| Field | Description | Example |
|---|---|---|
url | WordPress site base URL | https://my-site.com |
username | WordPress username | admin |
application_password | Application password generated in WordPress | xxxx xxxx xxxx xxxx |
Parameters
Section titled “Parameters”| Field | Type | Required | Description |
|---|---|---|---|
| credentials_id | credentials | Yes | WordPress credential |
| post_id | text | Yes | Post ID to update |
| title | text | No | New title (empty = no change) |
| content | textarea | No | New HTML content |
| status | select | No | New status: draft, publish, pending, private |
| categories | text | No | New categories (IDs separated by comma) |
| featured_media | text | No | New featured image ID |
Output
Section titled “Output”{ "success": true, "post_id": 123, "post": { "id": 123, "title": { "rendered": "Updated Title" }, "status": "publish" }, "message": "Post 123 updated"}Usage Example
Section titled “Usage Example”Publish a draft
Section titled “Publish a draft”{ "post_id": "123", "status": "publish"}Update title and content
Section titled “Update title and content”{ "post_id": "123", "title": "New Post Title", "content": "<p>Updated content with new information...</p>"}Change categories and featured image
Section titled “Change categories and featured image”{ "post_id": "123", "categories": "5,12", "featured_media": "789"}API Used
Section titled “API Used”- Endpoint:
POST /wp-json/wp/v2/posts/{id} - Documentation: WordPress REST API - Posts
- Only the specified fields are updated; the rest remain unchanged
- The post ID supports variables with
{{id}}syntax - Categories are completely replaced when updated (not appended)
- To change the featured image, you need the media ID
Related Nodes
Section titled “Related Nodes”- WordpressGetPosts - Get posts to identify which to update
- WordpressCreatePost - Create a new post
- WordpressDeletePost - Delete a post
- WordpressUploadMedia - Upload new featured image
- WordpressGetCategories - Get category IDs