First you enqueue a blacklist.js (or whatever filename you want) like so:
add_action( 'enqueue_block_editor_assets', 'my_blacklist' ); function my_blacklist() { wp_enqueue_script('blacklist-blocks', get_template_directory_uri() . '/yourpath/blacklist.js', array( 'wp-blocks', 'wp-dom-ready', 'wp-edit-post' ), filemtime( get_template_directory() . '/yourpath/blacklist.js' ), true); }
Then, on blacklist.js you put this (I put some core blocks as an example):
wp.domReady(function () { wp.blocks.unregisterBlockType('core/verse'); wp.blocks.unregisterBlockType('core/columns'); wp.blocks.unregisterBlockType('core/group'); } );