bricks_update_page_settings
Overview
Updates Bricks page-level settings using a deep merge strategy, meaning only the keys you provide are changed while all other settings remain untouched. This is the primary tool for configuring per-page SEO metadata, Open Graph social sharing tags, custom CSS, custom scripts, body classes, and layout overrides such as disabling the header or footer template.
The deep merge approach makes it safe to call repeatedly without overwriting previously configured settings. Ideal for adding SEO after page content is finalized or injecting page-specific scripts and styles.
Key Features
When to Use
Configure Open Graph tags for social media sharing
Add page-scoped custom CSS that only applies to one page
Inject custom scripts (header or footer) for tracking or third-party integrations
Disable the header or footer template on a specific page (e.g., landing pages)
Add extra body classes for page-specific styling hooks
Page ID must be known (use bricks_list_pages to find it)
For Open Graph images, upload the image first with bricks_upload_media
When NOT to Use
For global custom CSS — use bricks_add_custom_css with scope "global"
For changing the page status (draft/publish) — use bricks_update_page_status
Parameters
page_idnumberREQUIREDsettingsobjectREQUIREDsettings.bodyClassesstringoptionalsettings.headerDisabledbooleanoptionalfalsesettings.footerDisabledbooleanoptionalfalsesettings.documentTitlestringoptionalsettings.metaDescriptionstringoptionalsettings.metaKeywordsstringoptionalsettings.metaRobotsstringoptionalindex, noindex, follow, nofollow, noindex nofollowsettings.sharingTitlestringoptionalsettings.sharingDescriptionstringoptionalsettings.sharingImageobjectoptionalsettings.customCssstringoptionalsettings.customScriptsHeaderstringoptionalsettings.customScriptsBodyHeaderstringoptionalsettings.customScriptsBodyFooterstringoptionalCode 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
Configure SEO and Open Graph for a page
Sets the document title, meta description, and Open Graph tags for social sharing after the page content has been finalized.
bricks_update_page_settings({
page_id: 42,
settings: {
documentTitle: 'About Us | My Company',
metaDescription: 'Learn about our team, mission, and values. We build innovative solutions for modern businesses.',
metaRobots: 'index, follow',
sharingTitle: 'About Us | My Company',
sharingDescription: 'Meet the team behind My Company.',
sharingImage: { url: 'https://example.com/og-about.jpg', id: 123 }
}
})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
Create a distraction-free landing page
Disables header and footer templates and adds page-specific tracking scripts for a conversion-focused landing page.
bricks_update_page_settings({
page_id: 55,
settings: {
headerDisabled: true,
footerDisabled: true,
bodyClasses: 'landing-page no-nav',
customCss: '.landing-page .hero { min-height: 100vh; }',
customScriptsBodyFooter: '<script>fbq("track", "ViewContent");</script>'
}
})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
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
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
Tips & Warnings
Deep merge behavior: You can call this tool multiple times for the same page. Each call only updates the keys you provide, leaving all other settings intact. This is ideal for incremental configuration.
Script injection order: customScriptsHeader loads before page content, customScriptsBodyHeader loads right after the opening body tag, and customScriptsBodyFooter loads last — ideal for analytics and tracking pixels.
SEO best practices: Always set documentTitle and metaDescription as the last step in your page build workflow (Phase 4 step 3). Use the page content and purpose to write unique, descriptive meta tags.