Disable Specific Blocks for the Block Editor

If you would like to remove certain blocks from even showing in the block editor, Six/Ten Press Block Editor can help you disable them. You give it the list of blocks you want to disable, and the plugin does the rest, regardless of whether they’re registered using PHP or JavaScript. Here’s an example:

add_filter( 'sixtenpressblockeditor_disable_blocks', 'leaven_disallowed_blocks' ); /** * Define the blocks we are disallowing. * * @return array */ function leaven_disallowed_blocks( $blocks ) { return array_merge( $blocks, array( 'core/verse', 'core-embed/animoto', 'core-embed/cloudup', 'core-embed/collegehumor', 'core-embed/crowdsignal', 'core-embed/dailymotion', 'core-embed/funnyordie', 'core-embed/hulu', 'core-embed/imgur', 'core-embed/issuu', 'core-embed/kickstarter', 'core-embed/meetup-com', 'core-embed/mixcloud', 'core-embed/reverbnation', 'core-embed/screencast', 'core-embed/scribd', 'core-embed/slideshare', 'core-embed/smugmug', 'core-embed/ted', 'core-embed/tumblr', 'core-embed/videopress', 'core-embed/wordpress-tv', ) ); }
Code language: PHP (php)
Return to Six/Ten Press Block Editor