The ways I hate WordPress some days are endless. I’m pretty sure they think if they just keep renaming the patterns page ID maybe people will use it.
Nope — and my hot take is if you’re a nutty WordPress purist using any part of Gutenberg you’re a horrible developer. There.. I said it out loud.
Anyway, here is a a few methods to hide this nonsense from end users.
Method 1 – Works 6.9 – 7.0
add_action( 'admin_menu', function() {
remove_submenu_page('themes.php', 'site-editor.php?path=/patterns');
}, 999 );
Method 2 – doesn’t work anymore
add_action( 'admin_menu', function() {
remove_submenu_page( 'themes.php', 'edit.php?post_type=wp_block' );
}, 999 );
Method 3 – doesn’t work anymore
add_action( 'after_setup_theme', function() {
// Removes the default core patterns
remove_theme_support( 'core-block-patterns' );
});