bricks_validate_page
Overview
Pre-publish validation gate for a Bricks page. Performs focused checks on heading hierarchy, image alt text, meta description, placeholder links, global class usage, and lorem ipsum detection.
Unlike bricks_analyze_page which provides a comprehensive quality audit, this tool focuses specifically on publishing blockers. It returns a clear ready_to_publish boolean along with categorized errors (blocking) and warnings (advisory).
In strict mode, warnings for missing alt text, placeholder links, and lorem ipsum are promoted to errors, making this a hard gate for production deployments.
Key Features
When to Use
You want a quick pass/fail assessment instead of a full audit
You need to ensure no placeholder links (#, javascript:void, example.com) remain
You want to catch lorem ipsum text before going live
You need to enforce strict quality standards for production with strict: true
Bricks Builder version 1.9 or higher
When NOT to Use
You want to fix the found issues — use bricks_fix_audit_issues after identifying them
You want site-wide validation — run this on each page individually
Parameters
Warning: Undefined array key "param_enum_values" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 28
page_idnumberREQUIREDWarning: Undefined array key "param_enum_values" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 28
strictbooleanoptionalfalseCode 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
Basic pre-publish validation
Runs standard validation before publishing a page.
bricks_validate_page({
page_id: 33
})
// Returns:
// {
// ready_to_publish: false,
// errors: [
// { message: "Multiple h1 headings found (2)", element_id: "abc123" }
// ],
// warnings: [
// { message: "Image missing alt text", element_id: "def456" },
// { message: "Placeholder link found: #", element_id: "ghi789" }
// ]
// }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
Strict production validation
Runs strict validation where warnings become errors for production readiness.
bricks_validate_page({
page_id: 33,
strict: true
})
// In strict mode, missing alt text and placeholder links
// are promoted to errors, blocking publishing.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
Tip: Use strict: true for production-ready checks. This promotes missing alt text, placeholder links, and lorem ipsum from warnings to errors, creating a hard quality gate.
Tip: Run this after bricks_auto_responsive and before bricks_analyze_page in the Phase 5 polish workflow. Validation is faster than full analysis and catches the most critical issues.
Tip: After fixing validation errors, run the tool again to confirm the page passes. The ready_to_publish: true response gives confidence that the page is ready.
Warning: This tool checks content quality only, not functionality. A page can pass validation but still have broken interactive elements, incorrect query loops, or layout issues that require visual inspection.