Disable Gutenberg Blocks
Once I decided to use Gutenberg editor for my websites I faced with is the huge amount of default blocks, which is cool of course, but I’m such a minimalist.
In this tutorial I am going to show several ways how you can hide or completely restrict the usage of specific blocks on your website.
Gutenberg Block Manager
In this method we are not going to do any coding yet. This method was not possible before but in WordPress 5.2 the Block Manager was introduced – it is a build-in feature that allows you to turn off or turn on specific blocks on your website, at the moment of writing this article it is located in Preferences > Blocks. Very cool especially if you are not really into coding.
This is how it works:

But of course if you develop a custom theme and it shouldn’t support a certain block, you’d better deactivate the blocks via code and we are going to talk about in just a little bit.
Disable Gutenberg Blocks in Code
Using allowed_block_types_all to whitelist blocks
Or allowed_block_types
, depends on your WordPress version. I mean we used allowed_block_types
before but then it became deprecated in WordPress 5.8 and now we have to use allowed_block_types_all
filter.
So, using filter hook allowed_block_types_all
we can whitelist some specific blocks, that we are going to allow to use on the website. Check the example below, where we are going to hide all the blocks except Paragraph, Heading, Image and List blocks.
/*
* Whitelist specific Gutenberg blocks (paragraph, heading, image and lists)
*
* @author Misha Rudrastyh
* @link https://rudrastyh.com/gutenberg/remove-default-blocks.html#allowed_block_types_all
*/
add_filter( 'allowed_block_types_all', 'misha_allowed_block_types', 25, 2 );
function misha_allowed_block_types( $allowed_blocks, $editor_context ) {
return array(
'core/image',
'core/paragraph',
'core/heading',
'core/list',
'core/list-item'
);
}
Once you insert this code to your current theme functions.php
file, you would have this:

allowed_block_types_all
filter.A couple notes related to this code snippet
- You might ask – but how to find out block slugs for the filter? If you try
print_r( $allowed_blocks )
, it returns nothing. Why? Because by default the allowed blocks array is empty, which means to display all blocks. If we add something to this array, only the blocks from the array will be displayed. To make it easier for you I decided to mention all the default blocks in the next chapter of this tutorial. - The filter also have
$editor_context
argument available, it contains the information about the admin page where the Block Editor is currently running. Using this argument we are going to add some post type related conditions later.
If you decide to use allowed_block_types_all
filter, keep in mind, that neither plugins or themes will be able to add custom blocks! Here I described how to deal with that.
List of Gutenberg blocks
To make it more clear, I split the core blocks list by categories.
Text category:
Block slug | Block name |
---|---|
core/paragraph | Paragraph |
core/heading | Heading |
core/list and core/list-item | List |
core/preformatted | Preformatted |
core/pullquote | Pullquote |
core/table | Table |
core/verse | Verse |
Media category:
Block slug | Block name |
---|---|
core/image | Image |
core/gallery | Gallery |
core/audio | Audio |
core/cover | Cover |
core/file | File |
core/media-text | Media & Text |
core/video | Video |
Design category:
Block slug | Block name |
---|---|
core/buttons | Buttons |
core/columns | Columns |
core/group | Group |
core/row | Row |
core/stack | Stack |
core/more | More |
core/nextpage | Page Break |
core/separator | Separator |
core/spacer | Spacer |
Widgets category:
Block slug | Block name |
---|---|
core/archives | Archive |
core/calendar | Calendar |
core/categories | Categories |
core/html | Custom HTML |
core/latest-comments | Latest Comments |
core/latest-posts | Latest Posts |
core/page-list | Page List |
core/rss | RSS |
core/search | Search |
core/shortcode | Shortcode |
core/social-links | Social Icons |
core/tag-cloud | Tag Cloud |
Theme category:
Block slug | Block name |
---|---|
core/navigation | Navigation |
core/site-logo | Site Logo |
core/site-title | Site Title |
core/site-tagline | Site Tagline |
core/query | Query Loop |
core/posts-list | Posts List |
core/avatar | Avatar |
core/post-title | Post Title |
core/post-excerpt | Post Excerpt |
core/post-featured-image | Post Featured Image |
core/post-content | Post Content |
core/post-author | Post Author |
core/post-date | Post Date |
core/post-terms | Post Categories, Post Tags |
core/post-navigation-link | Next post, Previous post |
core/read-more | Read More |
core/comments-query-loop | Comments Query Loop |
core/post-comments-form | Post Comments Form |
core/loginout | Login/out |
core/term-description | Term Description |
core/query-title | Archive Title |
core/post-author-biography | Post Author Biography |
Embeds category:
Block slug | Block name |
---|---|
core/embed | Embed, Twitter, Youtube, WordPress, Soundcloud, Spotify, Flickr, Vimeo, Animoto, Cloudup, Crowdsignal, Dailymotion, Imgur, Issuu, Kickstarter, Mixcloud, Reddit, ReverbNation, Screencast, Scribd, Slideshare, SmugMug, Speaker Desc, TikTok, Videopress, WordPress.tv, Amazon Kindle, Pinterest, Wolfram |
Allow or Disallow Blocks for Specific Post Types
Do you remember, I mentioned that allowed_block_types_all
hook accepts $editor_context
parameter? Let’s use it now! For example, we will add one more block – Shortcode for Pages. In this case our code will be changed a little bit:
add_filter( 'allowed_block_types_all', 'misha_allowed_block_types', 25, 2 );
function misha_allowed_block_types( $allowed_blocks, $editor_context ) {
$allowed_blocks = array(
'core/image',
'core/paragraph',
'core/heading',
'core/list',
'core/list-item'
);
if( 'page' === $editor_context->post->post_type ) {
$allowed_blocks[] = 'core/shortcode';
}
return $allowed_blocks;
}
In this code snippet we get post type from a WP_Post
object, it is located, as you’ve probably guessed, in $editor_context->post
. So, you can even allow or disallow specific blocks by the post ID!
Here is my result for Pages:

How to Blacklist Specific Blocks?
In the examples above we used more like a whitelist solution. So we can specify specific blocks to whitelist – all the other blocks are going to be disabled. Like without exception at all. It means that not a single plugin that extends Gutenberg editor with blocks is going to do anything. And if you decide to create a custom block it won’t appear in inserter until you add it to whitelist.
So whitelisting doesn’t seem like a flexible solution and that’s why I decided to cover a blacklisting topic here as well.
We can blacklist any block with the same allowed_block_types_all
, but we will also need the list of all the registered blocks. WP_Block_Type_Registry::get_instance()->get_all_registered()
will help us with that.
Check this code out:
$registered_block_slugs = array_keys( WP_Block_Type_Registry::get_instance()->get_all_registered() );
echo '<pre>' . print_r( $registered_block_slugs, true ) . '</pre>';
/*
Array
(
[0] => core/archives
[1] => core/avatar
[2] => core/block
[3] => core/calendar
[4] => core/categories
... and so on
*/
Ok, let’s say that you don’t need Archives and Calendar blocks.
/*
* Blacklist specific Gutenberg blocks
*
* @author Misha Rudrastyh
* @link https://rudrastyh.com/gutenberg/remove-default-blocks.html#blacklist-blocks
*/
add_filter( 'allowed_block_types_all', 'misha_blacklist_blocks' );
function misha_blacklist_blocks( $allowed_blocks ) {
// get all the registered blocks
$blocks = WP_Block_Type_Registry::get_instance()->get_all_registered();
// then disable some of them
unset( $blocks[ 'core/archives' ] );
unset( $blocks[ 'core/calendar' ] );
// return the new list of allowed blocks
return array_keys( $blocks );
}
Do not forget to check the comments section below for more useful examples.

Misha Rudrastyh
Hey guys and welcome to my website. For more than 10 years I've been doing my best to share with you some superb WordPress guides and tips for free.
Need some developer help? Contact me
Good to know we can disable or “enable” them as needed :) I was already a bit scared when thinking about the next WordPress themes to build for customers having all the core blocks by default and thought about how to get all that block elements styled fitting to the rest of the theme.
Thanks for posting this tutorial – it’s very helpful!
perfect. Thank you indeed. Very useful!
Personally, when I first explored Gutenberg 6 months or so back I thought, “okay this is cool.”
While it is playing “catchup” to other website builders and applications out there, it’s still way better.
But then I explored it again…. and I thought, “okay, still cool for some, but way too much for others. It’s a solid foundation, but I’m already to strip it down quuuuite a bit.”
So cheers!
Will this deregister all blocks from plugins as well?
Hi Martin,
Yep
Hey this is very useful and something I was looking for to build the next custom themes. Thanks so much!
How do you include a custom block in the $allowed_blocks array?
Say I have a custom block named “custom-testimonial”. I tried the following and none seem to work:
‘core/custom-testimonial’
‘custom/custom-testimonial’
‘custom-testimonial’
Do you know what code will correctly include the custom block in the array so it is still included in the editor?
Hey Taylor,
You just have to find out how your custom block is registered, example:
So, in the above example it will be
misha/custom-testimonial
. Just pass it into the$allowed_blocks
array as well.Thanks for the article.
Just a headup: `core/text-columns` seems to have been renamed to `core/columns`.
Also, using this filter seems to prevent any reusable block to be used. Has anyone find a solution?
Ok, got it, had to add `’core/block’` to the allowed block list.
Hi,
Just spotted this blacklist option
https://wordpress.org/gutenberg/handbook/extensibility/extending-blocks/#using-a-blacklist
So you can just remove one block at a time, if that’s you’d rather than enable.
Thanks for the post!
That looks promising but one question, does this involve creating a plugin? I’m a new developer to wordpress and have not created a plugin yet. Modifying the functions.php file is more familiar for me. Would I have to learn how to create a plugin first before implementing this solution?
Also – thanks for the great tutorial Misha!
Hey Sarah,
To create a plugin – just create any folder in
wp-content/plugins
and put a .php file with the same name (as folder) there, in the beginning of the file add this:Done 🚀
Thanks Misha,
I couldn’t get blacklist and whitelist to work so this helped.
I also couldn’t find official documentation for the core slugs. Do you know if there’s an official list in the Gutenberg Handbook on wordpress.org?
No, I do not. I took all of this from the source code 🙃
I’m in your debt and appreciate that you took the time to document the process. Thanks again, I really didn’t want some of those embed blocks mucking up the editor experience. :D
😁
Always welcome! 👍
For those that are using the
acf_register_block
method, you will need to use the prefix ofacf/your_custom_block_name_here
.Also, found another quirk, if you use
'name' => 'your_custom_block_name_here'
when registering, you will need to replace underscores as hyphens.👏 super comment, also solved my problem with ACF ‘render_callback’ not working, i was using underscores for my render names
Thank you so much! I couldn’t figure why my blocks would not should up in the editor. This was the reason.
Thanks a bunch for this tutorial! I also noticed that if you’re inside the paragraph block and you click on the add block icon it shows an “Inline Elements” tab with “Inline Image” block inside of it.
How would you remove that?
‘core/media-text’ is missing from Layout Elements here. This is so strange to have to define ALL that you want when you want to exclude certain blocks.
Absolutely.
But if you want to allow just 4 blocks, it is ok, isn’t it?
I follow your tutorial and was able to successfully remove the default Gutenberg blocks. I am creating new blocks using ACF and am trying to add reusable blocks back to the editor. And ideas on how to do this? Thanks!
Hey Logan,
ACF seems a good plugin but I do not like it and never use it on my projects.
Sorry I think I said that wrong. Yes I am using ACF to create new blocks, BUT I do not think the issue is because of ACF. When I follow your tutorial and limit blocks based on post type I lose the option to make them reusable blocks. My question is do you know how to add that option back after limiting what blocks can be used by custom post types?
Yeah – this is one of things that stops this being 100%
I found these block IDs to add:
// — Reusable
‘core/block’,
‘core/template’,
…but reusable blocks remain disabled – any ideas Misha?
Hey Guys,
Currently no. But I will post any updates here.
Enables reusable blocks for me. Thanks.
The following worked for me. I use “hero” as an example block name, but you can of course use your own.
– in acf_register_block:
'name' => 'hero'
– in the allowed_block_types filter function:
return array( 'acf/hero' );
Searching for days for a solutions for this problem. Using acf/[name] did the trick. Andrei, you’re my Hero!
Well, I was looking for a way to remove a certain block from the editing page (I’m new to Gutenberg), and this post is definitely not what I was looking for. Oh well, moving on.
This was very helpful, thanks! As a non-developer type who doesn’t want to dig too far into the code is there any chance you (or someone else) might build a helpful plugin that allows you to “hide” all the block types you don’t want users to see? The amount of choices is really overwhelming when I am teaching clients how to use Gutenberg editor. I really only want to give them like 5-8 block choices.
Using `core/cover-image` doesn’t display the cover image block, has it been renamed?
Hey Sam,
Thank you for your comment!
Yes, it has been changed to
core/cover
.Non-developers can use this plugin – https://wordpress.org/plugins/disable-gutenberg-blocks/
Great article! Add
core/block
for reusable blocks. Text columns is now calledcore/columns
.This is true! Thank you!
Perfect thank you!
Wow, Thanks mate! it really helpful. btw, do you have an idea how I can auto display 1 block in an editor with disabling all default options?
Hey Jono,
hmm… maybe not disabling that 1 block?
I am having error while adding a block template. Can you please check and let me know where I am doing wrong as I have seen the code here
It looks like the
$args
forregister_post_type()
function, where is it in your code? 🙃Hi!
Does disabling some blocks in Block Manager exclude CSS styles on front-end?
Hey Rafix,
Nope
Hi,
I have not find any solution to remove
var wc_product_block_data = JSON.parse( decodeURIComponent( ....
That is added in footer by woocommerce.
If someone can help.
Thanks for all.
Hey Andrea,
Please try this code:
Hi there, great info!
I was wondering if it’s possible to allow blocks based on page template?
e.g.
I’ve tried something like this but so far I haven’t had any luck!
Hey Joe,
Could you please try something like that:
if( get_page_template_slug( $post ) == 'your-template-slug' ) {
This is exactly what I needed ! Thanks very much and have a great day
Thank you! 🙂 I wish you the same
Thanks for this. When and why would you use this over unregistering a block? Cheers.
Hi Misha,
First of all thanks for all these precious Gutenberg tips.
We are currently implementing Gutenberg at work, and I’d like to know if there’s any way to remove the default blocks groups (Most Used, Common Blocks, etc) and just display the allowed blocks in the popup without any group notion?
Thanks in advance, keep up the good work!
Jeremy
Thank you for this guide!
Does anybody have a list for the WooCommerce block names/slugs? I haven’t been able to find that.
Hi Jeppe,
You’re welcome and thank you for a great question! Here is the list.
Thank you for another great tutorial :)
I learned a lot about creating Gutenberg blocks from your tutorials.
Is it possible to limit blocks only on front page?
Thanks in advance,
Milenko
With WordPress 5.4
core/button
has now been renamed tocore/buttons
Thanks !
Removing blocks with the Block Manager doesn’t remove any page weight (doesn’t remove any CSS or other code. Bummer
Yep, you’re right
True, but restricting/reducing the blocks does reduce DOM lookup coming from JavaScript on the frontend and JS execution time in my case. This helps with the page loading experience, every little bit :)
Do you think it would be possible to remove blocks for a certain user role? for example I don’t want contributors to have access to all blocks only certain ones but want editors to have access to a few extra.
Regards
Philip
I worked it out!
Awesome! But I think it would be better to move a condition statement inside the function.
Just a quick note on this as I was using it just now:
The allowed_block_types filter is deprecated since WP version 5.8.
allowed_block_types_all is the filter to use now instead.
Cheers and ty for the post.
Been using your code with no issue up till now and since WordPress updated to 6.1.1 it seems that when you use the allowed blocks array for an editor the list block doesn’t work correctly. We noticed that you can add a block but are unable to hit enter to add a new list entry or use the toolbar indent options.
Hey Andy,
Thank you for a valuable comment. Yes, indeed, you can not use the list entries because they are also blocks now!
So you have to allow both
core/list
andcore/list-item
. I have just updated it in the tutorial.