Hide Customizer’s Widget Choices From The List

The only way to disable a Widget from appearing in this list is to unregister it. You can do that just in the customizer:

function unregister_customizer_widgets() {
    if ( is_customize_preview() ){
        unregister_widget('WP_Widget_Recent_Posts');
    }
}

add_action( 'widgets_init', 'unregister_customizer_widgets' );

But that will remove it from the page preview and the sidebars. Even if it is used somewhere on the page it will not be displayed, that is not a very useful solution. You could check if the widget has been used by looking in the sidebars_widgets option and hide it only if it had not been used, but again it is not very good solution.


Your best option here is to hide it with CSS and enqueue stylesheet only for the customizer:

function my_customize_preview_style() {
    wp_enqueue_style( 'new_customizer_style', get_template_directory_uri() . '/customizer-style.css' );
}
add_action( 'customize_controls_print_styles', 'my_customize_preview_style' );

Inside it hide the desired widgets and remember about !important as they all have inline display: block;.

But consider again if you have to hide the widget from the user, displaying in in one place and hiding in the other will be confusing.