One Way to Whitelist and Blacklist Blocks in Gutenberg

Gutenberg ships with a number of blocks but what if your client or project doesn’t need most of them? The Gutenberg Handbook explains how to create a whitelist and a blacklist for blocks but in some circumstances, Gutenberg does not respect the allowed_block_types filter.

Jason Bahl, a WordPress Engineer at Digital First Media, published a tutorial that explains how to whitelist and blacklist blocks using a filterable, localized array.

One thing to keep in mind is that Gutenberg development is in a high state of flux and Bahl warns that his technique is fragile and will likely cause things to break over time. He suggests keeping a close eye on Gutenberg development to see how blacklisting/whitelisting evolves in the plugin.