With WordPress’ templates, patterns, and template parts, you can conveniently and quickly create web pages. You can create these yourself, and some themes come packed with these building blocks to give you a head-start.
Unfortunately, WordPress also loads a ton of random patterns, from core as well as remote. I bumped into this annoying ‘feature’ on my quest for a replacement of the Genesis Framework.
When comparing themes, you don’t want patterns from another sources to interfere.
Searching the web for a solution, I found a post of AJ Clark at WPExplorer, titled How to Disable WordPress Gutenberg Block Patterns. The remedy is fortunately quite simple.
To remove the core patterns, we use:
add_action( 'after_setup_theme', function() {
remove_theme_support( 'core-block-patterns' );
} );
To prevent WordPress from loading remote patterns, we add:
add_filter( 'should_load_remote_block_patterns', '__return_false' );
You just need to put these code snippets in the functions.php of your theme.
Since I had setup a WordPress multisite, with separate sites for every theme in the test, I would have to add this code 25 times! You understand, I wasn’t looking forward to that.
Instead, I wrapped the code lines in a site specific plug-in, which I activated for the entire WordPress network.
<?php
/*
Plugin Name: Disable WordPress Core and Remote Block Patterns
Description: Unload Block Patterns of WordPress Core, and prevent downloading remote Block Patterns of WordPress. Credits to AJ Clarke of WPExplorer.
Version: 0.1
Author: wilwebs
Author URI: https://wilwebs.com
Source URI: https://www.wpexplorer.com/how-to-disable-wordpress-gutenberg-block-patterns/
License: GNU General Public License v3.0
License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/
// Disable WordPress Core Block Patterns
add_action( 'after_setup_theme', function() {
remove_theme_support( 'core-block-patterns' );
} );
// Disable WordPress Remote Block Patterns
add_filter( 'should_load_remote_block_patterns', '__return_false' );
The license details and credits are added because I’m posting the code here.
It all worked like a charm. Thanks AJ! Now I can continue testing.

Leave a Reply