Disable default block theme patterns


To disable the default block patterns in WordPress (so only your custom patterns are available), use the following method in your custom blank theme:

<?php
if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

add_action('init', function() {
    remove_theme_support('core-block-patterns'); // Disable default block patterns
});

add_filter('should_load_remote_block_patterns', '__return_false'); // Prevent fetching patterns from WordPress

Add this to the functions.php or you can use code snippet editors.

// newsletter

Three tested WordPress snippets a week

Blocks, security, performance, Tailwind, PHP and React. Copy, paste, ship. You’ll also get DPlugins product updates. No spam, and you can unsubscribe anytime.

// newsletter

Three tested WordPress snippets a week

Blocks, security, performance, Tailwind, PHP and React. Copy, paste, ship. You'll also get DPlugins product updates. No spam, and you can unsubscribe anytime.

Click to Copy