Remove WordPress's built-in block patterns and the patterns it downloads from WordPress.org, so the inserter only shows your own.
// Remove the patterns bundled with WordPress core.
add_action( 'after_setup_theme', function (): void {
remove_theme_support( 'core-block-patterns' );
} );
// Stop loading patterns from the WordPress.org pattern directory.
add_filter( 'should_load_remote_block_patterns', '__return_false' );
// Catch any remaining core/* patterns, whatever they are called in this version.
add_action( 'init', function (): void {
$registry = WP_Block_Patterns_Registry::get_instance();
foreach ( $registry->get_all_registered() as $pattern ) {
if ( str_starts_with( $pattern['name'], 'core/' ) ) {
unregister_block_pattern( $pattern['name'] );
}
}
}, 20 );
Always add PHP to a staging site first, or have FTP or file manager access ready, so you can undo it if something goes wrong.
The block inserter’s Patterns tab mixes three sources: patterns bundled with WordPress, patterns downloaded from the WordPress.org directory, and the ones your theme and plugins register. On client sites the first two are mostly noise. This snippet removes them so only your own patterns remain.
Removing the core-block-patterns theme support stops WordPress registering its bundled patterns. The should_load_remote_block_patterns filter stops the editor fetching patterns from WordPress.org, which also removes a remote request each time the editor loads.
The last part loops over every registered pattern and removes any whose name starts with core/. The old version of this snippet listed pattern names by hand. WordPress renames and replaces core patterns between releases, and unregistering a name that doesn’t exist triggers a “called incorrectly” notice. Reading the registry avoids both problems.
Patterns registered by your theme (including files in its /patterns folder), by plugins and the synced patterns you create in the editor are not touched. To remove a theme’s patterns too, change the check to match its prefix, for example str_starts_with( $pattern['name'], 'twentytwentyfive/' ).
Open the block editor, click the inserter and choose Patterns. The WordPress categories such as “Query” or “Featured” should be gone, and your theme’s patterns should still be there.