By default, WordPress comes with a way of grouping multiple blocks together. The Group block is a block that allows to group other blocks together inside one container.
Grouping multiple blocks into one container also allows to modify space between blocks in the group, using default options of the Block editor.
In this guide, I’ll show you how to group all blocks on the page into a single group, and modify space between blocks.
To group blocks into a singular container:
- Enable List View, by clicking on the List View icon, located in the top toolbar of the editor (left hand side).
- Select the latest block in the list, by clicking on it.
- Hold Shift key on your keyboard, and keep clicking on the Up Arrow key on your keyboard until you reach the first block in the list.
- Click on the Transform Icon.
- Transform selected blocks to Group.
To modify space between blocks:
- In the List View, select the first block, which should be Group.
- In the Block settings, locate Dimensions.
- Under Block spacing, set your value. For example, 4rem.
Once you are ready, make sure to Publish (Update) your changes.