Beginner‘s Guide: How to Use WordPress Block Patterns

Block patterns are one of the most useful features for WordPress users who want to create professional looking websites quickly and easily. In this complete beginner‘s guide, we‘ll explain what block patterns are, how to use them, find more patterns, create custom patterns, and more.

What Are WordPress Block Patterns?

Block patterns allow you to insert pre-designed layouts and content blocks into your WordPress posts and pages with just a few clicks.

For example, you can add a call-to-action section, image gallery, custom headers, button layouts, and more without having to build them from scratch every time. Block patterns save you a ton of time and effort.

WordPress block patterns

The block editor was introduced in WordPress 5.0 which allows you to build your content with blocks for paragraphs, images, galleries, buttons, etc.

Block patterns take these core blocks even further by letting you save and insert commonly used block layouts.

WordPress comes bundled with several useful block patterns to get you started. Premium WordPress themes and plugins also add extra patterns.

You can find patterns for:

  • Page layouts (columns, section headers)
  • Call to actions (buttons, images)
  • Content sections (media & text, stats, quotes)
  • Navigation (tabs, accordion, table of contents)
  • And many more…

The collection of available patterns grows bigger each day, giving you plenty of options to create professional looking content with minimal effort.

How to Use Block Patterns in WordPress

Using block patterns is very easy thanks to the intuitive WordPress block editor. Follow these steps:

  1. Edit the page or post where you want to add a pattern.

  2. Click on the Plus icon to open the block inserter.

  3. Go to the Patterns tab.

  4. Browse the available patterns or use the filters to find one you like.

  5. Hover over a pattern thumbnail and click the Insert button.

Insert a WordPress block pattern

That‘s it! The pattern will be instantly inserted into your content.

You can add as many patterns as you need in any order.

Some patterns like columns or section headers are designed as layout blocks. You can place other patterns inside of them to build a complete page layout.

After insertion, click on any individual element in the pattern to modify it. For example you can:

  • Change the text, font sizes, colors
  • Swap out the image
  • Adjust column widths
  • Update the button settings
  • And anything else just as you would with a normal block.

Modifying a pattern will not affect how it‘s displayed on other pages. Your changes are limited to only that single post or page.

This makes experimenting worry-free. Go ahead and tweak the patterns until you get the perfect custom layout.

Finding More Block Patterns to Use

The number of available block patterns will continue to grow, so be sure to check back periodically for new options.

WordPress plugins like Atomic Blocks and Stackable also add their own custom patterns.

For the largest selection of patterns, browse the official WordPress Pattern Directory.

You‘ll find hundreds of free patterns submitted by the WordPress community like:

WordPress pattern directory

Here are a few ways to use these directory patterns:

  • Preview – Click on a pattern to open a popup with a full size preview.

  • Copy – Hover over the pattern and click the Copy button to save it to your clipboard.

  • Import – Some patterns have an Import button that will automatically add them to your site.

  • Inserter – You can enable the Pattern Directory inside your editor to browse and insert directory patterns seamlessly.

To import a pattern from the directory:

  1. Click on the pattern title to open the details view.

  2. Scroll down and click the Import button.

  3. The pattern will be copied to your website and can be used immediately!

Enabling the Pattern Directory in your editor will let you insert directory patterns directly without having to copy/paste:

  1. Go to Settings → Block Patterns.

  2. Check the box for Pattern Directory.

  3. Click Update Settings.

Now browsing patterns will show directory results too for easy insertion!

How to Create and Share Your Own Block Patterns

You don‘t have to rely only on default or directory patterns. Creating your own custom patterns is easy and allows you to tailor options specifically for your site.

Creating Patterns to Reuse on Your Website

  1. Build something in the block editor that you want to save as a pattern. This can be a custom layout, styled section, buttons, etc.

  2. Switch to the Code Editor view.

  3. Copy all the content.

  4. Create a new Custom HTML block on the page where you want to use this pattern.

  5. Paste the code into the HTML block from step 3 to display your custom pattern.

  6. optionally, right click and save the HTML block as a Reusable block to quickly insert it again later.

Repeat those steps whenever you need to create new custom patterns for your site.

Submitting Patterns to the Directory

If you want to share your pattern for others to use:

  1. Go to the Block Pattern submission page.

  2. Build your pattern using the editor.

  3. Fill out title, description, and other details.

  4. Publish your pattern to the directory.

  5. It will now be available for other WordPress users to copy and import!

Creating custom patterns for the directory helps give back to the WordPress community.

Programmatically Register Block Patterns

You can also register block patterns in your theme‘s functions.php file or by using custom code plugins like WPCode.

This allows you to distribute patterns with themes and plugins.

function my_block_patterns() {

  register_block_pattern(
    ‘my-theme/pattern-name‘,
     array(
      ‘title‘       => __( ‘Pattern title‘, ‘my-theme‘ ),
      ‘description‘ => __( ‘Description for pattern‘ , ‘my-theme‘ ),
      ‘content‘     => ‘<!-- wp:columns {"align":"full"} --> <div class="wp-block-columns alignfull"><!-- wp:column --> <div class="wp-block-column"><!-- wp:paragraph {"align":"center","fontSize":"large"} --> <p class="has-text-align-center has-large-font-size">First column</p> <!-- /wp:paragraph --> </div> <!-- /wp:column --></div> <!-- /wp:columns -->‘,
    )
  );

}

add_action( ‘init‘, ‘my_block_patterns‘ );

Replace the title, description, and content with your own. Then the pattern can be used on your site.

See register_block_pattern() documentation for additional details.

Remove a Block Pattern in WordPress

Don‘t want to use a particular pattern anymore? They‘re easy to disable or unregister.

To temporarily hide a pattern from the inserter:

  1. Go to Settings → Block Editor.

  2. Select the Patterns tab.

  3. Uncheck the pattern name under the Show Patterns option.

  4. The pattern will no longer display in the inserter.

If you want to permanently remove or unregister a pattern:

function unregister_my_pattern() {
  unregister_block_pattern( ‘my-theme/pattern-name‘ );
}
add_action( ‘init‘, ‘unregister_my_pattern‘ );

Replace ‘my-theme/pattern-name‘ with the actual name of the pattern you want to remove.

This will completely disable that pattern from being used on your site.

Block Patterns vs Reusable Blocks

At first glance, block patterns seem similar to reusable blocks. But there are some important differences:

Reusable blocks:

  • Created and edited directly inside the editor.

  • Changes made to a reusable block apply everywhere it‘s used.

  • Limited flexibility. You get what you created originally.

Block patterns:

  • Registered from theme/plugin code for advanced control.

  • Modified on a per-post basis. Core pattern is unchanged.

  • More design flexibility since code can generate dynamic patterns.

So in summary:

  • Reusable blocks are best for repeating content unchanged across multiple pages.

  • Block patterns give greater design flexibility and customization for unique layouts.

Recap – How to Use Block Patterns in WordPress

  • Block patterns provide ready-made layouts and sections for your content.

  • Use built-in WordPress patterns or find more in the official directory.

  • Easily insert patterns into your pages and posts with the block editor.

  • Modify patterns individually by editing blocks after insertion.

  • Create custom patterns for your own site or submit to the public directory.

  • Manage pattern availability using code registration functions.

Learning how to leverage block patterns can help you save time, grow your design skills, and create professional looking WordPress sites faster than ever!

Written by Jason Striegel

C/C++, Java, Python, Linux developer for 18 years, A-Tech enthusiast love to share some useful tech hacks.