bricks_update_page
Update a WordPress page's Bricks Builder content. Saves elements with JSON validation, automatic backup, and optimistic locking to prevent overwrites.
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 from bricks_get_page for optimistic locking. If provided, update fails with 409 if page was modified since read. |