bricks_update_site_settings

UtilityIntermediateComplexity: 5/10
Update global Bricks settings

Overview

Updates Bricks global site settings stored in bricks_global_settings. Only the provided keys are changed; existing settings are preserved. This tool controls performance toggles, SEO behaviour, custom script injection, query filter activation, maintenance mode, and security options.

After updating settings, call bricks_regenerate_assets to ensure CSS changes take effect on the frontend.

Key Features

Partial Updates
Only the provided keys are updated; all other settings remain unchanged. Safe for incremental configuration.
Performance Tuning
Toggle smooth scroll, CSS loading method, lazy loading, emoji scripts, and XML-RPC in one call.
Script Injection
Set custom scripts for header, body header, or body footer positions. Used by CDN library tools internally.
Maintenance Mode
Enable maintenance mode with an optional template ID to show a custom maintenance page to non-admin visitors.

When to Use

To enable smooth scrolling for a polished user experience
To switch CSS loading from inline to file mode for production
To enable query filters before using bricks_add_query_filter
To inject custom scripts globally (header or footer)
To enable or disable maintenance mode during builds
To configure SEO and Open Graph settings
Prerequisites
Call bricks_get_site_settings first to understand the current configuration before making changes

When NOT to Use

When you need to change typography or element defaults — use bricks_update_theme_styles
When you need page-specific settings — use bricks_update_page_settings
When you want to add custom CSS — use bricks_add_custom_css for safer append operations

Parameters

1 Total Parameters1 Required
settingsobjectREQUIRED
Key-value pairs of settings to update. Only provided keys change. Common keys: smoothScroll, cssLoading ("file"/"inline"), disableLazyLoad, disableSeo, disableOpenGraph, enableQueryFilters, maintenanceMode, maintenanceTemplate, customScriptsHeader, customScriptsBodyFooter, disableEmoji, disableXmlRpc.

Code 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

Enable Smooth Scroll and File CSS

Enables smooth scrolling, switches CSS to file-based loading for production, and disables WordPress emoji scripts for performance.

JSON
bricks_update_site_settings({
  settings: {
    smoothScroll: true,
    cssLoading: "file",
    disableEmoji: true
  }
})

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

Enable Query Filters

Activates the query filter system required before using bricks_add_query_filter to create filter UI elements.

JSON
bricks_update_site_settings({
  settings: {
    enableQueryFilters: true
  }
})

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
After updating settings that affect CSS (like cssLoading), call bricks_regenerate_assets to rebuild the CSS files. Without this, changes may not appear on the frontend.

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
Setting customScriptsHeader or customScriptsBodyFooter replaces the entire value. Read the current value first with bricks_get_site_settings, then append your new scripts to the existing content.

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 enable maintenanceMode without setting maintenanceTemplate, visitors see a blank page. Always create a maintenance template first.

Tips & Warnings

Tips & Warnings

Script wrapping: Values in customScriptsBodyFooter are output raw into HTML. JavaScript must be wrapped in <script> tags or it will render as visible text on the page.

Production checklist: Before going live, set cssLoading to « file », disable emoji and XML-RPC, and ensure maintenance mode is off.

Return Values

FieldTypeDescription
successbooleanWhether the settings were updated successfully
updated_keysarrayList of setting keys that were actually changed
settingsobjectThe full updated settings object

Related Tools

Technical Details

Tool ID
bricks_update_site_settings
API Endpoint
/site-settings
HTTP Method
PUT
Namespace
wordpress-site
Source File
wordpress/site-settings.ts
Version
1.0
Min Bricks Version
1.9
Requires Auth
Yes

Changelog

v1.0
Initial release
20250101