bricks_reorder_sections

Phase 4BeginnerComplexity: 3/10
Rearrange root sections in a new order

Overview

Rearranges root-level sections on a Bricks page into a new order. You provide all section IDs in the desired sequence, and the tool reorders the flat element array so that sections (and all their descendant elements) appear in the specified order. Every root section must be listed — omitting a section will cause an error.

Key Features

Full section reordering
Moves entire sections including all child elements. Children stay grouped with their parent section.
Content area support
Can reorder sections in different content areas (content, header, footer).
Validation
Validates that all root sections are included in the new order — prevents accidental section loss.

When to Use

When the section order on a page needs to change (e.g., moving the CTA above the testimonials)
When reorganizing page layout after a design review
When A/B testing different section arrangements
After adding new sections that need to be positioned between existing ones
Prerequisites
Page must exist with Bricks content
You must list ALL root-level section IDs (use bricks_get_page_summary to see them)
Section IDs must be valid root elements (parent: 0)

When NOT to Use

When reordering elements within a section — use bricks_move_element instead
When you need to move a section to a different page — use bricks_copy_section + bricks_delete_section
When replacing a section entirely — use bricks_replace_section instead

Parameters

3 Total Parameters2 Required1 Optional
page_idnumberREQUIRED
Page ID containing the sections to reorder.
section_orderarrayREQUIRED
All root section IDs in the desired order. Every root section must be included.
content_areastringoptional
Content area to reorder.
Default: content Values: content, header, footer

Code Examples


Warning: Undefined array key "example_description" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 10

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

Move CTA section before testimonials

JSON
{
  "tool": "bricks_reorder_sections",
  "params": {
    "page_id": 33,
    "section_order": ["abc123", "def456", "mno345", "ghi789", "jkl012"]
  }
}
Response
{
  "success": true,
  "section_count": 5,
  "new_order": [
    { "id": "abc123", "label": "hero-section" },
    { "id": "def456", "label": "features-section" },
    { "id": "mno345", "label": "cta-section" },
    { "id": "ghi789", "label": "testimonials-section" },
    { "id": "jkl012", "label": "footer-cta" }
  ]
}

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
Every root-level section must appear in the section_order array. Omitting one will cause an error — this is a safety measure to prevent accidental section loss.

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
Only root section IDs should be in the array, not container or element IDs within sections.

Tips & Warnings

Tips & Warnings

Workflow tip: Use bricks_get_page_summary first to see all root section IDs and their labels, then construct the new order array. The summary gives you the current order and section labels for reference.

Safety: This tool requires ALL sections to be listed. If you only want to move one section, you still need to list every section in the desired order.

Return Values

FieldTypeDescription
successbooleanWhether the reorder was successful.
section_countnumberNumber of root sections reordered.
new_orderarrayArray of section IDs in the new order with their labels.

Related Tools

Technical Details

Tool ID
bricks_reorder_sections
API Endpoint
/bricks-mcp/v1/pages/{page_id}/sections/reorder
HTTP Method
PUT
Namespace
pages-elements
Source File
pages/utilities.ts
Version
1.0
Min Bricks Version
1.9
Requires Auth
Yes

Changelog

v1.0
Initial release
20250101