What is Gutenberg?
Gutenberg is a WordPress platform, block-based editor. Gutenberg published in November 2018, was introduced it. Since then, many website owners have abandoned the classic editor in favor of Gutenberg.
Why do you need to disable Gutenberg?
If you are not ready for the new WordPress 5 Gutenberg Editor, why not stick with the classic editor? If this seems familiar, then reading this page may assist you in Disabling WordPress Gutenberg Editor.
Follow these tips to disable the Gutenberg editor
1) : Disable Gutenberg Blocks in Code

You would have this after adding this code to your current theme’s functions.php file.
<?php
add_filter( 'allowed_block_types_all', 'cxc_allowed_block_types_call_back', 25, 2 );
function cxc_allowed_block_types_call_back( $allowed_blocks, $editor_context ) {
return array(
'core/image',
'core/paragraph',
'core/heading',
'core/list',
'core/list-item',
'core/html'
);
}
?>
2) : List of Gutenberg blocks editor
- List of Gutenberg blocks
Block Name | Block Slug |
Paragraph | core/paragraph |
Table | core/table |
List | core/list and core/list-item |
Heading | core/heading |
- Design Category
Block Name | Block Slug |
Columns | core/columns |
Row | core/row |
Page Break | core/nextpage |
Spacer | core/spacer |
Buttons | core/buttons |
Separator | core/separator |
- Media category
Block Name | Block Slug |
Gallery | core/gallery |
Media & Text | core/media-text |
Image | core/image |
Video | core/video |
- Theme category
Block Name | Block Slug |
Site Title | core/site-title |
Post Title | core/post-title |
Post Content | core/post-content |
Login/Logout | core/loginout |
Post Date | core/post-date |
Read More | core/read-more |
Post Featured Image | core/post-featured-image |
- Widgets category
Block Name | Block Slug |
Calendar | core/calendar |
Latest Comments | core/latest-comments |
Archive | core/archives |
Page List | core/page-list |
Social Icons | core/social-links |
RSS | core/rss |
Allow or Disallow Specific Post Type Blocks
<?php
add_filter( 'allowed_block_types_all', 'cxc_allowed_block_types_to_post_call_back', 25, 2 );
function cxc_allowed_block_types_to_post_call_back( $allowed_blocks, $editor_context ) {
$allowed_blocks = array(
'core/image',
'core/paragraph',
'core/heading',
'core/list',
'core/list-item',
'core/html'
);
// Show In Post Pages.
if( 'post' === $editor_context->post->post_type ) {
$allowed_blocks[] = 'core/shortcode';
}
return $allowed_blocks;
}
?>
How to Blacklist Specific Blocks?
<?php
$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
*/
?>
Assume you don’t need the Archives and Calendar blocks.
<?php
add_filter( 'allowed_block_types_all', 'cxc_blacklist_blocks_call_back' );
function cxc_blacklist_blocks_call_back( $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 );
}
?>
Was this article helpful?
YesNo