bricks_validate_page

Phase 5IntermediateRead OnlyComplexity: 4/10
Pre-publish validation gate for headings, alt text, placeholders

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

Ready-to-Publish Gate
Returns a clear ready_to_publish boolean. If any errors exist, the page is not ready. Warnings do not block publishing unless strict mode is enabled.
Strict Mode
When strict: true, missing alt text, placeholder links, and lorem ipsum are promoted from warnings to errors, creating a hard quality gate for production deployments.
Heading Hierarchy Check
Verifies exactly one h1 per page, no heading level gaps (e.g., h1 to h3 without h2), and proper nesting throughout the page.
Placeholder Detection
Scans for placeholder links (#, javascript:void(0), example.com), lorem ipsum text, and other dummy content that should be replaced before publishing.

When to Use

You are about to publish a page and need a final quality check
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
Prerequisites
The target page must exist and contain Bricks elements
Bricks Builder version 1.9 or higher

When NOT to Use

You want a comprehensive quality audit — use bricks_analyze_page instead
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

2 Total Parameters1 Required1 Optional

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_idnumberREQUIRED
The WordPress page ID to validate.

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
strictbooleanoptional
Strict mode: promotes missing alt text, placeholder links, and lorem ipsum from warnings to errors. Use true for production-ready checks.
Default: false

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

Basic pre-publish validation

Runs standard validation before publishing a page.

JSON
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.

JSON
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
Default mode allows placeholder links and missing alt text as warnings. For production sites, always use strict: true to catch these as blocking errors.

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
Running validation on a page still under construction will report many false positives. Wait until the page content is finalized before running the validation gate.

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 tool detects lorem ipsum and other placeholder text patterns. Even if the heading hierarchy is correct, placeholder text means the page is not ready for publishing.

Tips & Warnings

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.

Return Values

FieldTypeDescription
ready_to_publishbooleanWhether the page passes validation. False if any errors exist.
errorsarrayArray of blocking error objects with message, element_id, and check category.
warningsarrayArray of advisory warning objects with message, element_id, and check category.

Related Tools

Technical Details

Tool ID
bricks_validate_page
API Endpoint
/pages/{page_id}/validate
HTTP Method
POST
Namespace
analysis
Source File
analysis/validation.ts
Version
1.0
Min Bricks Version
1.9
Requires Auth
Yes

Changelog

v1.0
Initial release with heading hierarchy, alt text, meta description, placeholder links, global class usage, and lorem ipsum checks. Includes strict mode.
20250101