wp_update_post
Update any existing WordPress post by specifying only the fields to change, such as title, content, status, categories, or featured image. Includes validation and change tracking.
Instructions
Updates an existing WordPress post with comprehensive validation and change tracking. All parameters except ID are optional - only provided fields will be updated.
Usage Examples:
• Update title: wp_update_post --id=123 --title="New Title"
• Update content: wp_update_post --id=123 --content="<p>Updated content</p>"
• Change status: wp_update_post --id=123 --status="publish"
• Update categories: wp_update_post --id=123 --categories=[1,5,10]
• Set featured image: wp_update_post --id=123 --featured_media=42
• Remove featured image: wp_update_post --id=123 --featured_media=0
• Multiple updates: wp_update_post --id=123 --title="New Title" --status="publish" --categories=[1,2]
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| site | No | The ID of the WordPress site to target (from mcp-wordpress.config.json). Required if multiple sites are configured. | |
| id | Yes | The ID of the post to update. | |
| title | No | The new title for the post. | |
| content | No | The new content for the post, in HTML format. | |
| status | No | The new publishing status for the post. | |
| excerpt | No | The new excerpt for the post. | |
| categories | No | An array of category IDs to assign to the post. | |
| tags | No | An array of tag IDs to assign to the post. | |
| featured_media | No | The ID of the featured media (image). Use 0 to remove featured media. | |
| date | No | The date the post was published, in the site's timezone (ISO 8601 format). |