Let me tell you “How to show only the post titles with WP search and don’t show description or meta data”?

- Open the admin dashboard.
- Select Appearance
- Select Theme File Editor.
- Open search.php.
- Find the section of code that outputs the search results. This may vary depending on your theme, but mostly it involved a loop that outputs each result.
- Find the code that outputs the post title.
- This code I find in search.php of my wp theme.
<div class="news-list-post-wrap column--one"> <?php while ( have_posts() ) : the_post(); ?> <li><font><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></font></li> <?php endwhile; do_action( 'digital_newspaper_pagination_link_hook' ); ?> </div>
- I replaced the above code with the code given below to update search.php
<?php while ( have_posts() ) : the_post(); ?> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <?php endwhile; ?>'
- Now, only post title will appear in search results.