To remove the Newsletter Glue post type from WP search, add this snippet to your favorite snippets plugin:
add_filter( 'pre_get_posts', function( $query ) {
if ( ! is_admin() && $query->is_search() && $query->is_main_query() ) {
$post_types = $query->get( 'post_type' );
if ( empty( $post_types ) || $post_types === 'any' ) {
$post_types = get_post_types( [ 'public' => true ] );
}
if ( is_string( $post_types ) ) {
$post_types = explode( ',', $post_types );
}
$post_types = array_diff( (array) $post_types, [ 'newsletterglue' ] );
$query->set( 'post_type', array_values( $post_types ) );
}
return $query;
} );