I would like to be able to create sections of blocks from within the Gutenberg editor. This way I can apply styles around groups of blocks.

The idea would be to either:

  • Nest one or more blocks within a container div/section/article
  • Add an opening tag before a block or group of blocks and a closing tag afterwards

I have tried adding a 'Custom HTML' block before and afterwards with opening/closing tags. This works apart from when revisiting the editor the you're welcomed with a 'This block contains unexpected or invalid content' warning.

How can I achieve this?

2 Answers 2


Use 'Groups': If you do not see the 'Group' option, like me, you'll have to update WP.

After that, simply create a group, then add new blocks or drag existing blocks into it. Select the group and add HTML Anchors and classes via the 'Advanced' tab of the block's menu.


There's a simple solution, use a group block:

enter image description here

This creates a group block that contains the others. This isn't the only block that can have "children" or nest other blocks, e.g. columns, cover blocks, etc

Group blocks are <div>'s but can also be set as sections/asides/etc in the block inspector sidebar

If this wasn't an option, the solution would have been to build a block that contains other blocks, but those blocks already exist and come with WP

  • Thanks for pointing me to this Tom.
    – Scoop
    Commented Mar 26, 2020 at 7:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.