bricks_delete_theme_style

Phase 2BeginnerDestructiveComplexity: 3/10
Delete a theme style

Overview

Permanently deletes a theme style from Bricks Builder. The style and all its settings (typography, colors, element defaults, conditions) are irrecoverably removed.

After deletion, pages that were using this style will fall back to the next matching theme style based on condition specificity, or to Bricks’ built-in defaults if no other theme style matches.

Key Features

Permanent Deletion
Completely removes the theme style and all associated settings from the bricks_theme_styles option in the WordPress database.
Graceful Fallback
Pages previously using the deleted style automatically fall back to the next matching theme style by condition specificity, or Bricks defaults.

When to Use

Removing an obsolete or test theme style that is no longer needed
Cleaning up duplicate theme styles after a site migration
Replacing one theme style with another that has been properly configured
Prerequisites
The theme style must exist (use bricks_get_theme_styles to verify)
Ideally another theme style should exist to provide fallback styling
Confirm no critical pages depend exclusively on the style being deleted

When NOT to Use

When you want to update an existing style (use bricks_update_theme_styles instead)
When deleting the only theme style — this will leave the site with no custom typography settings
When you are unsure which style is active on which pages (use bricks_get_theme_styles first to check conditions)

Parameters

1 Total Parameters1 Required
style_idstringREQUIRED
Theme style ID to delete. Use bricks_get_theme_styles to find available IDs.

Code Examples

Delete a test theme style

Remove a theme style that was created for testing purposes.

JSON
{
  "style_id": "test-style"
}
Response
{
  "success": true,
  "message": "Theme style 'test-style' deleted successfully."
}

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
If you delete the only theme style, the site will lose all custom typography, heading margins, and element defaults. Always ensure a replacement style exists first.

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
Always run bricks_get_theme_styles first to understand which pages depend on the style being deleted and verify fallback coverage.

Tips & Warnings

Tips & Warnings

Warning: This action is permanent and cannot be undone. There is no trash or soft-delete for theme styles.

Tip: Before deleting, use bricks_get_theme_styles to export the current settings in case you need to recreate them later.

Tip: If you want to replace a style, create the new one first with bricks_create_theme_style, verify it works correctly, then delete the old one.

Return Values

FieldTypeDescription
successbooleanWhether the theme style was deleted successfully.
messagestringConfirmation message or error description.

Related Tools

Technical Details

Tool ID
bricks_delete_theme_style
API Endpoint
/design-system/theme-styles/{style_id}
HTTP Method
DELETE
Namespace
design-system
Source File
design-system/theme-styles.ts
Version
1.0
Min Bricks Version
1.9
Requires Auth
Yes

Changelog

v1.0
Initial release.
20250101