Exclude “Page templates” from Search

Add this code snippet in Child theme function.

function wplms_custom_search_filter($query) {
 
if ( !$query->is_admin && $query->is_search && $query->is_main_query() && !isset($_GET['post_type'])) {
      $query->set( 'meta_query', array(
          'relation' => 'OR',
          array(
              'key'     => '_wp_page_template',
              'value'    => 'start.php', // page template file name
              'compare' => '!=',
          ),
array(
              'key'     => '_wp_page_template',
              'value'    => 'create_content.php', //page template file name
              'compare' => '!=',
          ),
      ));
  }
 
return $query;
}
add_filter( 'pre_get_posts', 'wplms_custom_search_filter' );