Using this handy function on the allowed_block_types_all (Codex) hook, you can create an “allow list” of Gutenberg block editor blocks to disable default or plugin blocks that you don’t want or need. I don’t expect this will have much if any of a performance benefit, but it is helpful for reducing editor clutter!

Rather than deleting the array items you don’t want, I recommend that you simply comment them out by prepending the line with a // so you can easily reenable them later if needed.

This code can go in your functions.php file or a custom plugin.

	Set allowed block types to remove some unhelpful defaults
function addycodes_allowed_block_types($allowed_blocks) { 
	return array(
add_filter('allowed_block_types_all', 'addycodes_allowed_block_types');

Get a list of all available Gutenberg block editor blocks

As the block editor evolves it’s likely that the array of blocks in the sample code above will change and this post will drift out of date. You’ll probably also have some plugins that add their own blocks or even your own custom ones.

To find a list of all block names on your site, simply:

  1. Log in to your admin area and open up any post or page in the Gutenberg editor
  2. Open the developer tools panel in your browser and go to the ‘Console’ tab
  3. Paste the following code wp.blocks.getBlockTypes() in to your console and press enter to run
  4. The console should return an array of all available block names that you can use in the above snippet, you may need to expand the view to see them all

Make sure you do not already have the snippet above in place when requesting the blocks list, else you’ll only see your allowed ones.

Common plugin block names

Advanced Custom Fields (ACF)

If you’re using the ACF Advanced Custom Fields block API, your block names will be acf/block-name.

Contact Forms

Contact Form 7

The Contact Form 7 form block is contact-form-7/contact-form-selector.

Gravity Forms

The Gravity Forms form block is gravityforms/form.