How to Disable All Patterns Using Pattern Wrangler
While you may be a fan of the block editor, you may not be a fan of block patterns. With Pattern Wrangler, you can easily hide all patterns. In this “How To,” I’ll show you how.
How to disable patterns with a code snippet
If a plugin is not our thing, here’s a snippet on how to disable block patterns altogether.
<?php
/**
* Disable local patterns.
*/
add_filter(
'rest_wp_block_query',
function ( $query_args ) {
$query_args['post__in'] = array( -1 ); // -1 so no patterns are returned.
return $query_args;
},
10,
1
);
/**
* Disable remote patterns.
*/
add_filter( 'should_load_remote_block_patterns', '__return_false' );
/**
* Deregister the rest of the patterns.
*/
add_action(
'init',
function () {
// Retrieve all patterns.
$patterns = \WP_Block_Patterns_Registry::get_instance();
$all_patterns = $patterns->get_all_registered();
// Loop through all patterns and deregister them.
foreach ( $all_patterns as $index => $pattern ) {
unregister_block_pattern( $pattern['name'] );
}
},
2000
);
Paste this snippet into a site-specific plugin, code snippet plugin, or MU-Plugin.
Disabling patterns with the free Pattern Wrangler plugin
For a no-code and Multisite-friendly solution, install the free Pattern Wrangler plugin.
Navigate to its settings, which you can find under Patterns->Settings.
Find “Hide all Patterns”, toggle it to on, and save the settings.
Alternatively, hide the Patterns menu item (recommended if hiding patterns) under Appearance.
Your patterns should now be hidden.
Conclusion
In this short “How To,” I demonstrated, via code and the WordPress plugin Pattern Wrangler, how to disable all patterns.










