Wordpress 6.5: Disable "Available to install" block advertisements

raw

functions.php

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/**
 * Disable "Available to Install" block suggestions.
 *
 * @link https://github.com/n7studios/disable-block-pattern-suggestions
 */
function mytheme_disable_block_suggestions()
{
    remove_action(
        'enqueue_block_editor_assets',
        'wp_enqueue_editor_block_directory_assets'
    );
    remove_action(
        'enqueue_block_editor_assets',
        'gutenberg_enqueue_block_editor_assets_block_directory'
    );
}
 
add_action('admin_init', 'mytheme_disable_block_suggestions');
Christian Weiske Christian Weiske
owner

History