Set post meta
wp_update_post_metaCreate or overwrite one meta value of a post: every stored value of the key is replaced, so a repeated call leaves the same state. Takes id, key and value (any JSON value; an array or object is stored as a serialized array); the key is stored lower-cased (sanitize_key). Refused: keys starting with "_", credential-like keys and keys the account may not edit. Page-builder data — keys such as panels_data, dslc_code, pagelayer-data, brizy, mfn-page-items or tve_updated_post (filter ab_mcp_pro_markup_meta_keys) — takes the unfiltered_html capability, which on a multisite network only a super admin has; the texts of page-builder pages change with wp_update_builder_element. The value is stored as given, backslashes included (\u0026 in block JSON stays \u0026). Returns updated, id and key; an unknown post is a not-found error. Needs edit_posts and the right to edit the post; no undo point is recorded. wp_get_post_meta reads the value; wp_update_post sets several keys through its meta field. Forwarded by AlphaBridge Connect to the one site this connection reaches.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Post id. | |
| key | Yes | Meta key; stored lower-cased (sanitize_key). | |
| value | No | Any JSON value; an array or object is stored serialized. Omitted: an empty string. |