Hi there,
not sure about this, but you can try this PGP snippet:
add_action( 'pre_get_posts', 'my_search_exclude_filter' );
function my_search_exclude_filter( $query ) {
if ( ! $query->is_admin && $query->is_search && $query->is_main_query() ) {
$searchable_post_types = get_post_types( array( 'exclude_from_search' => false ) );
$post_type_to_remove = 'web-story';
if( is_array( $searchable_post_types ) && in_array( $post_type_to_remove, $searchable_post_types ) ) {
unset( $searchable_post_types[ $post_type_to_remove ] );
$query->set( 'post_type', $searchable_post_types );
}
}
}
I am making the assumption that the web stories post type slug is: web-story