What is a block pattern?
A block pattern is a preset combination of blocks and settings. They are meant to be used on several different posts and pages in order to maintain consistent layouts. Once added to a layout, block patterns can be fully customized and maintain no relationship to other instances of the same block pattern.
What are Gutenberg block patterns used for?
Block patterns are used as a starting point for creating consistent layouts. A theme developer may create a custom block pattern for a section of a page that is intended to appear similar across the site. One example of this would be a set of blocks commonly used for the intro of every page.
Creating and using block patterns helps prevent “reinventing the wheel.” If there is a common layout that will be used across the site, creating a block pattern will make it quicker and easier to apply that layout.
Block patterns typically include placeholder text and customized settings like colors and alignment. Everything can be modified once you add the block pattern to the editor. Unlike reusable blocks, block patterns retain no connection to similar instances. (This means if you change a block pattern on one page or post, it will have no effect on the pattern used on another page or post. Additionally, the base block pattern can only be modified via code.)
What block patterns come with WordPress core?
WordPress does offer a selection of block patterns in its core installation. The real benefit of block patterns comes in developing custom patterns, however the default block patterns are also useful.
Block Patterns Included with WordPress Core
- Two buttons
- Three buttons
- Two columns of text
- Two columns of text with images
- Three columns of text with buttons
- Two images side by side
- Large header with a heading
- Large header with a heading and a button
- Heading and paragraph
How do I make my own block patterns for WordPress?
Block patterns are fairly simple to create with a little knowledge of PHP and the WordPress theme framework. I recommend following this “How to Build Block Patterns for the WordPress Block Editor” tutorial by Rich Tabor.
If you don’t feel comfortable writing code, here is a promising plugin for creating block patterns. This is obviously a young plugin, but it appears promising.
Like Gutenberg, block patterns are still new to the WordPress world. As they become more established and more widely used there will be many more resources for creating block patterns from scratch or with a plugin.
Gutenberg and all of its components are driven by the desire to make WordPress easier to use. Block patterns are one of the newest additions to the WordPress editor. They help create consistent layouts and complex layouts without having to recreate the wheel every time. While block patterns currently aren’t as easy to create and manage as reusable blocks, they certainly have their place and will undoubtedly become easier to create and edit.