thincms_update_post
Update an existing blog post with partial field changes. Supports HTML content, SEO metadata, status changes, and automatic 301 redirect on slug change.
Instructions
Update an existing blog post. Only provided fields are changed (partial update). Content should be raw HTML. For large content (>10KB), use contentFile instead of content. Changing slug auto-creates a 301 redirect from the old URL.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Post ID (required) | |
| slug | No | URL slug (changing slug auto-creates a 301 redirect) | |
| tags | No | Array of tag names (full replacement) | |
| title | No | Post title | |
| jsonLd | No | Custom JSON-LD (Schema.org) injected verbatim into the post <head>. Pass valid JSON as a string. Set to empty string to clear. | |
| series | No | Series name | |
| siteId | No | Override the active site for this single call. Pass to target a specific tenant without mutating shared active-site state — the right pattern when running concurrent agent sessions managing different tenants. Must match a siteId from your THINCMS_SITES config (use thincms_list_sites to inspect). When omitted, the call uses the active site set by thincms_switch_site. | |
| status | No | Post status | |
| content | No | HTML content | |
| excerpt | No | Short summary/excerpt | |
| noIndex | No | Exclude from search engine indexing | |
| authorId | No | Author ID | |
| featured | No | Mark as featured | |
| metaTitle | No | SEO meta title | |
| ogImageUrl | No | Open Graph image URL | |
| categoryIds | No | Array of category IDs (full replacement) | |
| contentFile | No | Local file path containing HTML content — use this instead of content for large posts (>10KB). | |
| gatePreview | No | Custom HTML teaser shown before the gate. | |
| pinnedUntil | No | ISO date: pin until this date | |
| publishedAt | No | DEPRECATED — use scheduledFor. ISO date for publication date. | |
| scheduledAt | No | DEPRECATED — use scheduledFor. Legacy field. | |
| seriesOrder | No | Order within series | |
| canonicalUrl | No | Canonical URL | |
| scheduledFor | No | Override visibility timing. "immediate" or an ISO 8601 timestamp at least 60 minutes in the future. | |
| gatedFormSlug | No | Form slug to gate this post behind. Set to empty string to remove gating. | |
| membersContent | No | HTML content visible only to authenticated members/subscribers. | |
| metaDescription | No | SEO meta description | |
| confirmProductionWrite | No | Acknowledge that this call may write to a configured production site (THINCMS_PRODUCTION_SITE_IDS env var). Required for any POST/PUT/PATCH/DELETE against a production-listed site; ignored otherwise. The error message lists which site triggered the requirement and recommends thincms_snapshot before any production write. |