0

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?

enter image description here

2

2 Answers 2

1

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

-1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.