I have this function in my theme's functions.php file:
remove_theme_support( 'core-block-patterns' );
which works great but does not remove the Query patterns. How can I include those to be removed in this function?
I have this function in my theme's functions.php file:
remove_theme_support( 'core-block-patterns' );
which works great but does not remove the Query patterns. How can I include those to be removed in this function?
You can disable all "experimental block patterns" including the query block patterns by adding a filter:
add_action( 'init', function() {
add_filter(
'block_editor_settings_all',
function ($editor_settings) {
$editor_settings['__experimentalBlockPatterns'] = [];
return $editor_settings;
}
);
});
You can see all editor settings (that you could disable with this filter) in this comment: https://developer.wordpress.org/reference/hooks/block_editor_settings_all/#comment-5661
My fix for this issue is editing the Gutenberg plugin and removing the blocks there. I have not found a way to cleanly remove them through functions.php.