WPLift is supported by its audience. When you purchase through links on our site, we may earn an affiliate commission.
Best Practices for Using Gutenberg Patterns and Blocks in Custom Themes

It’s no secret that Gutenberg Patterns and blocks have been a game-changer for developers of modern WordPress themes and the website creators who use them.
Whether you’re creating a truly unique, one-of-one custom theme or simply looking to completely transform an existing theme and make it your own, the better you understand these increasingly fundamental components of WordPress web design, the easier your job will be and the more impressive the results.
In this guide, you’ll learn:
- The key differences between blocks and patterns – And why both are essential for modern WordPress themes.
- Best practices for structuring themes with blocks – To ensure flexibility, consistency, and a streamlined workflow.
- Advanced tips to make the most of Gutenberg in your themes – From block-based templates to custom block development.
Ready to unlock the true potential of Gutenberg blocks and patterns?
Let’s get into it:
What are Gutenberg Patterns and Blocks?
Gutenberg blocks and patterns are the fundamental components used to create pages and posts within the Gutenberg block editor.
With its launch in 2018, Gutenberg marked a major shift in the WordPress experience, moving away from a heavy reliance on shortcodes, widgets, and the classic editor, and introducing a true WYSIWYG (What You See Is What You Get) experience directly into the core platform.
Ultimately, this allowed WordPress to compete with the growing popularity of drag-and-drop site builders like Wix and Squarespace and appeal to non-technical users looking for an easy and affordable way to create rich, visually impressive page layouts with zero coding knowledge
At the heart of this transition lay Gutenberg blocks and, later, patterns.
Let’s take a look at each one in turn:
Gutenberg Blocks
Literally the blocks that build your posts and pages, blocks are the core foundation of the Gutenberg editor. From paragraphs of text to images and even functional features like contact forms and maps, they all exist as blocks that can be added, rearranged, and customised at the click of a button.
For example, say you wanted to create a striking header section on your home page with the following elements:
- Call to Action button.
- Heading
- Text
- Image

First, you might use the ‘Container’ block to establish a layout for your section.

From there, you can then add all of your desired elements into that container as blocks and, finally, customize those blocks with your own content.

It’s quick, it’s simple, and it’s effective, but here’s the thing:
Gutenberg Patterns are even quicker and simpler.
Gutenberg Patterns
Rather than building sections from scratch, patterns allow you to insert pre-designed layouts made up of multiple blocks.

In that sense, they’re like ready-made templates for common design elements such as hero sections, pricing tables, or call-to-action banners.
The best part is that if none of the pre-existing patterns quite work for your theme or the type of content you want to display, you can also create your own.

For example, if your site contains multiple pages that all essentially have the same layout with different content, you can create that layout once using a pattern, and then effortlessly incorporate it into every page in a single click.

Whether you’re building a theme for your own site or to sell to other WordPress users, this is an effective way to make the whole process of building page layouts much more efficient.
That said, if you’re going to really maximize design efficiency and avoid potential problems along the way, it really pays to keep the following best practices in mind:
Best Practices for Using Gutenberg in Custom Themes
1. Take a ‘Block-First’ Approach to Custom Design
When we talk about a ‘block-first approach,’ we’re essentially talking about eschewing the PHP-based template files of old with a way of designing themes using the modular, block-based system of Gutenberg.
For example, instead of coding a blog post layout in the single.php file, you can use a Query Loop Block in a single.html template, making it easily editable from the WordPress dashboard.
From there, you can make the most of your theme.json file, positioning it as a central configuration file responsible for your theme’s style and overall behavior.
For example, instead of writing custom CSS for buttons, you could add the following code to your theme.json file:
{
“styles”: {
“elements”: {
“button”: {
“color”: {
“background”: “#ff6600”,
“text”: “#ffffff”
},
“border”: {
“radius”: “5px”
}
}
}
}
}
This ensures consistent styling across the site while at the same time giving users the freedom to change things to their preferred styles in the WordPress Customizer or Global Styles panel.
2. Use Core Blocks Wherever Possible
While custom blocks can be a great way to implement unique features and bespoke design choices, there’s already a healthy number of core Gutenberg blocks that can serve most design purposes really well.

Groups, Grids, and Container Blocks, for example, offer absolute flexibility for almost any kind of layout, while simply changing the style options of most content blocks is usually enough to meet most design preferences.
Sure, custom blocks have their place, but they’re best left for those occasions when you need highly specific functionality that core blocks can’t provide.
For example, rather than creating a custom testimonial block, consider using a Group Block with a Quote Block inside, then style it using block variations.
That way, you minimize the need to introduce more PHP and CSS code than is necessary, helping to keep your theme as lightweight as possible, while also avoiding the risk that your custom block will be incompatible with future WordPress updates.
3. Design Frequently-Used Layouts as Patterns
Never underestimate what an absolute time-saver Block Patterns can be.
Rather than starting from scratch every time you want to use a common layout on multiple pages, simply create that layout once, save it as a pattern, and reuse it over and over by inserting the entire layout as a single block.

For example, say you want each blog post to end with a uniquely designed Call to Action featuring your social media accounts, followed by a block of related posts.
You’d create that once as a pattern, save it as something like ‘BLOG CTA’, and then insert that ready-made pattern when you’re done creating your post content.
Not only is it a massive time-saver, but it can also be a great way to make your theme more user-friendly.
For example, if you’re designing a theme for others, offering a selection of pre-designed patterns unique to your theme can be a tremendous selling point, allowing non-technical users to create complex page designs with relative ease.
These patterns can be delivered via the WordPress Pattern Directory. Alternatively, if you’d prefer to make them 100% exclusive, you can hardcode them and register them within your theme using theme.json or register_block_pattern().
For example, the following code for a custom hero section pattern uses register_block_pattern() to make the pattern available for selection in the Block Inserter menu.
register_block_pattern(
‘mytheme/hero-section’,
array(
‘title’ => __( ‘Hero Section’, ‘mytheme’ ),
‘description’ => __( ‘A full-width hero section with a heading and button.’, ‘mytheme’ ),
‘content’ => ‘<!– wp:cover {“overlayColor”:”black”,”minHeight”:400} –>
<div class=”wp-block-cover”>
<h2>Welcome to Our Site</h2>
<p>Build something amazing with WordPress</p>
<a href=”#” class=”wp-block-button”>Get Started</a>
</div>
<!– /wp:cover –>’,
)
);
3. Understand the Difference Between Synced and Unsynced Patterns
If you do decide to use patterns, it’s absolutely imperative that you understand the difference between synced and unsynced patterns.

These are pretty much what they sound like:
A. Synced Patterns
When you add a pattern to a page, change its content, and then save those changes as a synced pattern, those changes will appear on every page where that pattern is featured.
Let’s give you an example:
Say you create a pattern with a Call to Action that directs people to your contact page. You save this as a synced pattern and use it all over your website.
Then, you reconfigure your website, or perhaps you decide it’s more pertinent for your CTAs to direct people to a specific landing page featuring your new lead magnet.
Rather than going back and manually changing that CTA on every page where it’s featured, you add it into a new post, change the content with new text pointing to the lead magnet, and save it.
Now, all pages that used to feature the contact page CTA are now automatically featured to display the new lead magnet CTA.
B. Unsynced Pattern
With unsynced patterns, any changes you make on a single page are not reflected on other pages.
This can be a good thing.
Say you want to create a page template that allows you to combine multiple types of content relating to episodes of a podcast.
This might include video and audio players, show notes, and a description.

So, you’d save that as a pattern, then insert it as a ready-made layout every time you’re ready to publish a new episode.
Since the content is unsynced, you can customize the content in that layout to reflect your current episode, without worrying about those changes replacing the content for all the other podcast episode pages you created previously.
The key here is to know which type of pattern to use and when.
For patterns where you want the content to change frequently, like page layouts, stick to unsynced patterns.
For those where the content should be the exact same on every page, use synced ones.
4. Optimize for Performance and Usability
Blocks may make life easier for users, but all that design freedom and flexibility shouldn’t come at the expense of performance, accessibility, and overall usability.
After all, what’s the point of whizzing through the creation of a great-looking site only to find that it’s awfully slow or doesn’t function correctly on a visitor’s mobile device?
Taking our advice to use core blocks wherever possible and keeping styling options to theme.json rather than relying on multiple CSS files will go a long way to help with that, but don’t stop there.
Here’s some other ways to ensure your theme is fast, accessible, and easy for both site owners and end users:
- Optimize images – Use performance-friendly formats like WebP, compress your image files and enable lazy loading to reduce load times.
- Keep block nesting to a minimum – Adding blocks within blocks within blocks (for example, a header within a container within another container) can put a strain on performance speeds.
- Follow WCAG guidelines – Maintain proper color contrast (4.5:1), scalable fonts, and clear focus indicators.
- Keep layouts intuitive – Avoid overly complex structures that make editing difficult for users.
Best Practices for Theme Building With Gutenberg Patterns and Blocks:
Key Takeaways
Whether you’re creating a unique look for your own website or developing a bespoke theme that serves as a revenue generator for your WordPress development business, using Gutenberg blocks and patterns is the way forward.
Not only does it save you time in putting the whole thing together, but it can also help you improve performance and make the site easier for others to edit.
Before you head off to start exploring the endless possibilities of blocks, let’s recap the key points we’ve discussed today:
- Keep Custom Blocks to a Minimum – The library of core Gutenberg blocks, coupled with extensive styling options, should be enough to satisfy all but a few niche design needs. Using them as much as possible helps increase efficiency and reduce theme bloat.
- Determine if Patterns Should be Synced or Unsynced – Use the former for site-wide changes and the latter for individual pages with unique content.
- Build With End Users in Mind – No matter how you build your themes, actual human site visitors should always be at the forefront of everything you do. Remember to build with performance, accessibility, and all-round usability as the end goal.
Looking to maximize Gutenberg’s potential? Check out these top WordPress block editing tips.