bricks_delete_menu
Overview
Deletes a WordPress navigation menu and all of its menu items permanently. This is a destructive operation that cannot be undone. The menu is removed from any assigned theme locations and all nav_menu_item posts associated with it are deleted.
Use bricks_list_menus first to find the correct menu ID and verify you are deleting the intended menu.
Key Features
When to Use
When replacing an old menu with a completely new structure
To clean up duplicate or test menus created during development
When NOT to Use
When you want to unassign a menu from a location without deleting it — update the location assignment
Parameters
menu_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
Delete a Menu by ID
Permanently deletes menu with ID 42 and all its items. Find the menu_id via bricks_list_menus first.
bricks_delete_menu({ menu_id: 42 })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 1939
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 1939
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
Irreversible: Menu deletion cannot be undone. Always verify the menu ID using bricks_list_menus before deleting.
Template impact: If a deleted menu was assigned to a nav-menu element in a header or footer template, that element will render empty until a new menu is assigned via bricks_assign_menu_to_element.