Gutenberg PHP Beginner

Remove Default Block Patterns from the Inserter

Last updated: May 6, 2026

WordPress ships with a set of built-in block patterns, pre-designed layout templates available from the pattern inserter in the block editor. It also fetches additional patterns remotely from the WordPress.org pattern directory by default. For most custom sites and client builds, these generic patterns are noise: they don’t match your design system, they pull in block configurations that may conflict with your theme, and they give clients access to layouts you didn’t design or account for.

Removing them keeps the inserter clean and ensures that when a client opens the pattern library, they see only the patterns you’ve intentionally provided.

The Code

Add this to your functions.php or a site-specific plugin. It runs on the init hook, which fires after block patterns are registered, making it safe to unregister them at that point.

Two Separate Mechanisms

Block patterns in WordPress come from two places, and this snippet addresses both.

The first block, the loop calling unregister_block_pattern(), removes patterns that are registered programmatically by WordPress core. The list in the snippet covers the core query loop patterns and the social links pattern. If your version of WordPress has registered additional core patterns not in this list, you can discover them by temporarily adding var_dump( WP_Block_Patterns_Registry::get_instance()->get_all_registered() ) to a template file and checking the output.

The second line, remove_theme_support( 'core-block-patterns' ), suppresses the remote pattern fetch from WordPress.org entirely. Without this, WordPress makes an API request on each admin page load to populate the Pattern Directory tab in the inserter. Removing this theme support eliminates that network request and removes the entire remote pattern library from the inserter UI.

Registering Your Own Patterns

Removing the defaults is most useful when paired with your own registered patterns that match your design system. You can register patterns using register_block_pattern() on the same init hook, or by placing .php files in a /patterns/ directory in your theme, which WordPress 6.0+ picks up automatically.

Selective Removal

If you want to remove only some core patterns rather than all of them, simply reduce the array to the specific slugs you want to unregister. Pattern slugs follow the format namespace/slug, core patterns use the core/ namespace, and third-party plugin patterns typically use their own namespace. You can find the exact slug for any registered pattern in the WP_Block_Patterns_Registry.

functions.php
add_action( 'init', function() {
    // Remove all patterns shipped with WordPress core
    $core_patterns = [
        'core/query-standard-posts',
        'core/query-medium-posts',
        'core/query-small-posts',
        'core/query-grid-posts',
        'core/query-large-title-posts',
        'core/query-offset-posts',
        'core/social-links-shared-background-color',
    ];

    foreach ( $core_patterns as $pattern ) {
        unregister_block_pattern( $pattern );
    }

    // Suppress all remotely fetched patterns from wordpress.org
    remove_theme_support( 'core-block-patterns' );
} );

Built by Nahnu Plugins

Need something more powerful than a snippet?

Our commercial plugins go further, built for serious WordPress sites with full support, updates, and documentation included.

Browse All Plugins →

This website uses cookies to enhance your browsing experience and ensure the site functions properly. By continuing to use this site, you acknowledge and accept our use of cookies.

Accept All Accept Required Only