Title: Create a search engine
Last modified: August 21, 2016

---

# Create a search engine

 *  [wchandler2](https://wordpress.org/support/users/wchandler2/)
 * (@wchandler2)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/create-a-search-engine/)
 * will someone tell me how create a search like the one on this website…
    [http://www.trulia.com/](http://www.trulia.com/)
 * I want people to be able to search my pages NOT my posts. I have a similar real
   estate website where I’d like my clients to be able to search by square footage,
   monthly rental rate and location. That’s pretty much it. If anyone can help me
   I will forever be grateful and when I have grand kids I’ll tell them stories 
   of how you are my he

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [rletc](https://wordpress.org/support/users/rletc/)
 * (@rletc)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/create-a-search-engine/#post-4256750)
 * something along these lines
 *     ```
       function SearchFilter($query) {
         if ($query->is_search) {
           // Insert the specific post type you want to search
           $query->set('post_type', 'page');
         }
         return $query;
       }
   
       // This filter will jump into the loop and arrange our results before they're returned
       add_filter('pre_get_posts','SearchFilter');
       ```
   
 * in your functions.php
 * perhaps
 *  Thread Starter [wchandler2](https://wordpress.org/support/users/wchandler2/)
 * (@wchandler2)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/create-a-search-engine/#post-4256753)
 * Is there a more simple way to do it?
 *  [rletc](https://wordpress.org/support/users/rletc/)
 * (@rletc)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/create-a-search-engine/#post-4256759)
 * Looks like this plugin can be configured to search only what you want:
 * [http://wordpress.org/plugins/search-everything/](http://wordpress.org/plugins/search-everything/)
 * it says you can exclude posts but I haven’t used it.
 * try googling “wordpress search plugin exclude posts” or “wordpress search plugin
   only pages” or whatever
 * e.g. [http://wordpress.org/plugins/simply-exclude/](http://wordpress.org/plugins/simply-exclude/)
 *  Thread Starter [wchandler2](https://wordpress.org/support/users/wchandler2/)
 * (@wchandler2)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/create-a-search-engine/#post-4256773)
 * Thank you. What I don’t get is how to actually get a search function. I have 
   my search.php but don’t get how to actually have a search engine on my website.
 *  [rletc](https://wordpress.org/support/users/rletc/)
 * (@rletc)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/create-a-search-engine/#post-4256780)
 * you mean you want to add the search box?
 * the code for that is <?php get_search_form(); ?> afaik
 * you might want to look in the widgets section, there may be a search box in there
   you can just drag into the sidebar.
 *  Thread Starter [wchandler2](https://wordpress.org/support/users/wchandler2/)
 * (@wchandler2)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/create-a-search-engine/#post-4256786)
 * Here’s my website… hidefspaces.com
    it only has a little search box at the top
   right that isn’t really customizable. I’d like to have maybe just a page itself
   that is used to search properties like the one on trulia.com

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Create a search engine’ is closed to new replies.

## Tags

 * [category](https://wordpress.org/support/topic-tag/category/)
 * [pages](https://wordpress.org/support/topic-tag/pages/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 2 participants
 * Last reply from: [wchandler2](https://wordpress.org/support/users/wchandler2/)
 * Last activity: [12 years, 7 months ago](https://wordpress.org/support/topic/create-a-search-engine/#post-4256786)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
