Find all WordPress posts that contain a certain word

Without adding any tags or categories, I need a way to generate a page that lists all WordPress posts containing the word, for example, “design” somewhere within them. Does anyone know how to do this?

Related posts

Leave a Reply

1 comment

  1. You can use WP_Query to do a search:

    <?php
    $query = new WP_Query( 's=keyword' );
    
    if ($query->have_posts()){
      while ( $query->have_posts() ) { $query->the_post();
        echo '<h2>';
          the_title();
        echo '</h2>';
        the_content();
      } //end while
    }
    

    Let me know how it went!