bricks_get_history
Overview
Retrieves the complete revision history of a Bricks page. Returns a chronological list of all saved revisions, each with a unique revision ID, timestamp, author name, change summary, and element count. WordPress automatically creates revisions when page content is saved, and the MCP tools create revisions before destructive operations.
Use this tool to review the change history before restoring a previous version with bricks_restore_revision, or to audit who made changes and when during a collaborative build process.
Key Features
When to Use
To audit the change history of a page during a build session
To verify that a snapshot was created successfully
When debugging unexpected content changes to trace when they occurred
To review the revision count and element counts over time
WordPress revisions must not be disabled (wp-config.php WP_POST_REVISIONS should not be 0).
When NOT to Use
To create a named save point — use bricks_snapshot instead
Parameters
page_idnumberREQUIREDCode Examples
Warning: Undefined array key "example_output" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 12
Review history and restore a revision
Get the page history, identify the correct revision by its summary and timestamp, then restore it.
// Step 1: Get revision history
const history = bricks_get_page_history({ page_id: 42 });
// Returns: { revisions: [
// { revision_id: 156, date: "2025-01-15T14:30:00", author: "admin", summary: "Added hero section", element_count: 12 },
// { revision_id: 148, date: "2025-01-15T13:00:00", author: "admin", summary: "Snapshot: Before redesign", element_count: 8 },
// ...
// ] }
// Step 2: Restore the snapshot revision
bricks_restore_revision({ page_id: 42, revision_id: 148 })Common Mistakes
Warning: Undefined array key "fix_description" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 47
Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-includes/kses.php on line 2018
Warning: Undefined array key "wrong_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 48
Warning: Undefined array key "right_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 49
Warning: Undefined array key "fix_description" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 47
Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-includes/kses.php on line 2018
Warning: Undefined array key "wrong_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 48
Warning: Undefined array key "right_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 49
Tips & Warnings
Best practice: Create named snapshots with bricks_snapshot before making major changes. Snapshots are easier to identify in the history than anonymous auto-revisions.
Revision limits: WordPress may limit the number of stored revisions via the WP_POST_REVISIONS constant. Older revisions may be automatically pruned.