A block pattern checker tells you whether your WordPress block pattern markup is valid before you paste it into the editor or commit it to your theme. If you have ever seen the dreaded “this block contains unexpected or invalid content” warning, you know how easy it is to break a pattern with one missing comment. Here is how to validate your markup fast.
What block pattern markup looks like
WordPress block patterns are reusable block-markup layouts. Under the hood, the block editor stores each block as an HTML comment, like <!-- wp:paragraph --> and <!-- /wp:paragraph -->. The visible HTML sits between the opening and closing comments, and any block attributes ride along as JSON inside the opening comment.
A pattern is just a chunk of that markup, usually saved in your theme’s patterns folder as a PHP file or registered against theme.json. Because the structure depends on those comment delimiters being balanced and correctly named, a single typo can make the whole pattern fail to load.
What the checker validates
The Block Pattern Checker inspects the markup you paste in. It does not fetch URLs or pull patterns from a live site, so nothing leaves your browser. It reads your block comments and flags the structural problems that break patterns:
- Unbalanced block delimiters, such as an opening
<!-- wp:group -->with no matching close. - Misspelled or unregistered block names that the editor will reject.
- Malformed attribute JSON inside an opening comment.
- Nesting that does not line up, which is the usual cause of invalid-content warnings.
Catching these before you load the pattern saves you from debugging a silent failure inside the Site Editor.
How to check a pattern in three steps
- Copy the block markup from your pattern file, a reusable block, or the editor’s Code view.
- Open the Block Pattern Checker and paste the markup into the input.
- Read the validation results, fix any flagged delimiters or attributes, and paste the corrected markup back into your theme.
The whole thing runs client-side, so you can validate sensitive client work without uploading anything.
When to use it
Reach for the checker whenever you are hand-editing pattern files, converting a design into block markup, or moving patterns between projects. It is also handy right before a release: a quick paste-and-check confirms every pattern in your theme will register cleanly instead of erroring out for users.
Related tools
- WordPress Salt Generator: refresh your security keys while you are tidying up theme files.
- WordPress Theme & Plugin Detector: see what theme and plugins a site runs when you are reverse-engineering a layout.
- wp-config Generator: build a clean wp-config.php for the site you are testing patterns on.
Paste your markup, fix what the checker flags, and ship patterns that load right the first time.