Actions17
Custom Post Type → Update
AI-generatedSummary
Updates a record of a specific Custom Post Type (CPT) on the WordPress site.
Inputs
- postType (required) — The post type to work with. Choose from the list, or specify an ID using an expression.
- cptId (required) — Unique identifier for the record.
- cptUpdateFields — A collection of fields to update. Supported fields include title, content, excerpt, slug, status (draft/publish, etc.), authorId, featuredMediaId, and JSON objects for ACF Fields and Meta Fields.
Output shape
A single record representing the updated Custom Post Type.
The returned data reflects the state of the record on the WordPress site after the update.
Examples
Example 1: Change the status of a specific product to draft.
Resource: Custom Post Type, Operation: Update. postType: product. cptId: 123. cptUpdateFields: status = draft.
Example 2: Update the title and featured image of a news article.
Resource: Custom Post Type, Operation: Update. postType: news. cptId: 456. cptUpdateFields: title = 'New Headline', featuredMediaId = 789.