bricks_update_page
Update Bricks Builder page data with automatic backup and JSON validation. Supports optimistic locking via content_hash to prevent overwriting concurrent changes to content, header, or footer areas.
Instructions
Update the Bricks Builder data for a page. Automatically creates a backup before writing. Validates the JSON structure before saving. Supports optimistic locking via content_hash. Use content_area to write header or footer template data. THEME-FIRST: before generating elements, call bricks_get_theme_styles and bricks_list_global_classes — reuse existing tokens (button styles, utility classes, color palette) instead of inline styling. For buttons prefer settings.style: "primary"|"secondary" over manual _background/_typography. For links use the text-link element, not a styled text-basic. Use _cssCustom only for what settings cannot express.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page_id | Yes | WordPress page/post ID | |
| bricks_data | Yes | Array of Bricks elements to save | |
| content_area | No | Which content area to write (default: content). Use header/footer to manage template elements. | content |
| content_hash | No | Content hash for optimistic locking, from bricks_get_page. Locking is per content_area: for header/footer use content_hashes.header / content_hashes.footer, NOT content_hash (that is the content area). If provided, the update fails with 409 if that area changed since you read it. |