| WordPress

how to reuse blocks in WordPress Gutenberg

One of Gutenberg's most useful features is the ability to reuse blocks. You can turn any block into a reusable block, speeding up your workflow and helping to maintain your website’s look and feel.

In this tutorial, I will show you how to reuse WordPress Gutenberg blocks, and we also have a free video guide for you.


Introducing reusable blocks

If you have a page or post and within it you have a paragraph, map, button, or anything that you are likely to want to use somewhere else on the site, instead of having to cut and paste from one page or post to another, you can save the content and easily reuse it anywhere else that you might need it.

These blocks can then be updated just once and those changes will show wherever you have used the block. This can save a lot of time and ensure that you don’t have outdated information lurking on some of your older pages.

For instance, you might want to have a weekly highlight that should appear on each post and be updated every week with a new link. You can do this very easily with the reusable block feature, without having to go to every post and update them all.


Video introduction to resuable blocks in Gutenberg

This video is part of our Gutenberg class on YouTube and explains how to use resuable blocks in Gutenberg.

Save 60% on your first invoice when you host your WordPress site with GlowHost. Click this link and use the coupon "WPGUTENBURG" .

 

 


Getting started with resuable blocks in Gutenberg

  • Simply add the block that you want to use.
  • Click on the three vertical dots and then "Add to Reusable Blocks".

Add to Reusable Blocks in Gutenberg

  • You are then prompted to give the block a name.

Naming a Reusable block in Gutenberg

Once this is done, you can use this block on other pages and posts.

  • On a new page or post, go to add a block by clicking on the ‘+’ symbol on the left and then scroll down the options until you find "Reusable" with the intertwined arrows right at the bottom of the list.

Finding a reusable block in Gutenberg

You will find a list of all your reusable blocks and you can select the one you want.

You will be able to see what type of block each one is. Here the paragraph symbol indicates the simple text blocks. If you had chosen to create a reusable columns block then you will have something like this.

Different icons for Reusable Blocks in Gutenberg

Alternatively, you can search for your reusable block using its name and select it that way.

Searching for a reusable block in Gutenberg

These reusable blocks are now stored in the database and you can make changes to them and these changes will be reflected everywhere.

  • Go to "Manage all Reusable Blocks". You will find a listing that looks very like a normal posts listing. So if you have made a spelling mistake or need to update a link, you can edit this information only once.

Manage all Reusable Blocks in Gutenberg

  • Just click on the block title and you can edit it like you would any other post.

Edit a Reusable Block in Gutenberg

  • If you decide you don’t want the block on one particular page to reflect the changes made to the reusable block, you can make it a regular block again and it will no longer be updated when you making changes to the reusable blocks.

Convert a Reusable Block to a Regular block in Gutenberg


Creating templates with reusable blocks

You can use this reusable blocks feature to create custom templates for posts and pages.

Because reusable blocks are essentially just posts and you can add some blocks and content to them, you can use them as fully-fledged templates.

  • Simply create a new post and create a reusable block.

Custom templates for posts and pages

  • Then go to the reusable blocks manager and open the block you intend to use as a template.

Use a block for a template

  • Once you are in the manager, you can set up the block to have the layout you wish to use for all your posts or a specific type of post. For example, You can add a headline, introductory paragraph, image, quote, and gallery.

Creating a template in Gutenberg

  • To use this template, create a new post, click on the "+" sign and select the template from the reusable blocks section. You now have an editable and reusable template!

Using a new template in Gutenberg

Summary of Reusable Blocks

In other posts about Gutenberg, I've been critical of some features. For example, the Columns feature is a mess. However, Reusable blocks are one of Gutenberg’s most powerful features. They are surprisingly easy-to-use. Reusable blocks promise to save a lot of time and make the creation of complex pages much easier.

More Gutenberg Reading


The video introduction to Gutenberg

WordPress 5 is here with a brand new editor called Gutenberg that changes the way posts and pages are created and edited. This video is your complete guide to Gutenberg! Thanks to our friends at Glowhost for making this video possible: Save 60% on your first invoice when you host your WordPress site with GlowHost. Click here and use the coupon "WPGUTENBURG".


About the author

Born in Zambia but living now in Cape Town, South Africa, Libby Young started out as a journalist. She taught herself HTML when the company where she was an sub-editor made the transition from CD-Rom to the web 20 years ago. Since then she has developed content-rich websites using a variety of open source content management systems.