Allowing Only Some Blocks and Disabling the Rest, Hiding/Disabling Blocks in the Block Editor
add_filter('allowed_block_types_all', 'enable_selected_core_blocks', 10, 2); function enable_selected_core_blocks($allowed_blocks, $post) { // List of core block types to enable $core_blocks_to_enable = [ 'core/paragraph', 'core/image', 'core/heading', 'core/quote', 'core/list' ]; return $core_blocks_to_enable; }