bricks_delete_font

Phase 2BeginnerDestructiveComplexity: 2/10
Delete a custom font

Overview

Deletes a custom font from Bricks Builder. Removes the font family registration and all its variants (weight/style combinations) from the database.

Elements that reference the deleted font in their font-family setting will fall back to the next font in their font stack, or to the browser default. This does not delete the actual font files from the media library — only the Bricks font registration.

Key Features

Complete Removal
Removes the font family and all its weight/style variants from the Bricks font registry.
Graceful Fallback
Elements using the deleted font automatically fall back to the next font in their CSS font stack. No errors or broken pages.

When to Use

Removing an unused custom font to reduce page weight
Replacing one custom font with another (upload new first, then delete old)
Cleaning up test fonts that were uploaded during development
Switching from self-hosted fonts to Google Fonts or Adobe Fonts
Prerequisites
The font must exist (use bricks_get_fonts to find the font_id)
Ideally update theme styles and classes to use a different font-family before deleting

When NOT to Use

When the font is actively used in theme styles or global classes (update those references first)
When you want to remove Google Fonts (those are managed through Bricks settings)
When you want to remove Adobe Fonts (use bricks_set_adobe_fonts to reconfigure)

Parameters

1 Total Parameters1 Required
font_idstringREQUIRED
Font ID to delete. Obtain this from bricks_get_fonts response.

Code Examples

Delete a custom font

Remove a font by its ID after confirming it is no longer needed.

JSON
{
  "font_id": "d4e5f6"
}
Response
{
  "success": true,
  "message": "Font 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 theme styles or global classes reference the font-family being deleted, text will fall back to the browser default. Always update typography settings before deleting a font.

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
The parameter is font_id (a hex string like "d4e5f6"), not the font_family name. Use bricks_get_fonts to look up the correct ID.

Tips & Warnings

Tips & Warnings

Warning: Font deletion is permanent. The @font-face registration is removed from the database immediately.

Tip: The actual font files in the media library are not deleted. If you also want to remove the files, delete them separately from the WordPress media library.

Tip: Before deleting, update typographyBody and typographyHeadings in theme styles to use a replacement font.

Return Values

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

Related Tools

Technical Details

Tool ID
bricks_delete_font
API Endpoint
/design-system/fonts/{font_id}
HTTP Method
DELETE
Namespace
design-system
Source File
design-system/fonts.ts
Version
1.0
Min Bricks Version
1.9
Requires Auth
Yes

Changelog

v1.0
Initial release.
20250101