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.

Would you like to write for WP Tavern? We are always accepting guest posts from the community and are looking for new contributors. Get in touch with us and let's discuss your ideas.


  1. This might be the start of a Customization API? I think about things like Roles, which Jason has said are not yet dealt with Server side, but we have a lot of things Server side…or do those somehow go Client side?


  2. If you check [the stats]( instead of the volume of hot air which some people are trying to blown up your petutie, you’ll find that the Average Install Growth Rate is at its lowest point ever, and Gutenblocks still rates just 2.5 stars, with more than twice as many people thinking its average to poor as those who think its the DBs.


Comments are closed.