search.php to search only the post title

I'm trying to rewrite my search.php to search only for the post titles because I have a ton of posts published to my site (around 400k), which slows down the search speed to about 20s per search.

?php get_header();
$search_term = $_GET['s'];
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$posts = new WP_Query( array(
        's'     = $search_term,
        'ep_integrate'   = true,
        'post_type'      = 'post',
        'posts_per_page' = 21,           
        'orderby' = 'date',
         'order'   = 'DESC',
         'paged' = $paged,
    ) );
?
?php if ($posts-have_posts()) :
?
main
div class=container mt-5
    h4 Results for ?php the_search_query(); ?/h4
    hr style=margin-top: 0;
    div class=row clear full-img ...

Topic get-posts wp-query php query-posts Wordpress search

Category Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.