Disable the block directory in WordPress

Disable the block directory in WordPress on child sites.

Snippet Type

Execute on Child Sites

Snippet

remove_action( 'enqueue_block_editor_assets', 'wp_enqueue_editor_block_directory_assets' );
1 Like

Does this remove everything related to Gutenberg blocks? Styles etc from front end as well?

I was just looking for a way to fully remove it all since I don’t use it.

You can disable the block editor for posts and widgets using the following code snippet.

add_filter('use_block_editor_for_post', '__return_false', 10);
add_filter( 'use_widgets_block_editor', '__return_false' );

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.