Tool to generate code for your WordPress Block Patterns

Turn copied Gutenberg block markup into a PHP pattern-registration snippet you can keep in your theme or plugin.

We made a little tool to make it easier to make the code snippet you need to add patterns in your functions.php file.


Paste your blocks here

Paste serialized Gutenberg blocks. The tool escapes backslashes and quotes for a PHP single-quoted string, then puts the content into the registration snippet below.


Copy the above code and insert it into your functions.php or plugin file. You may also change the name and description in the snippet. We also wrote a short guide on how to add Patterns, read it here.


You can also use the editor

Use WordPress’s built-in pattern creation when you only need a reusable editor pattern. Theme registration is useful when the pattern belongs in version-controlled theme or plugin code. See our pattern guide and the Theme Handbook.

Good things, occasionally.

Fresh ideas, useful tools and better ways to build. Delivered when we have something worth sharing.