Title: Replace standard WordPress search by custom SQL query
Last modified: August 20, 2016

---

# Replace standard WordPress search by custom SQL query

 *  [MacGyver_](https://wordpress.org/support/users/macgyver_/)
 * (@macgyver_)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/replace-standard-wordpress-search-by-custom-sql-query/)
 * Is it possible to replace the standard Search query by a custom SQL query ? How
   can i do this ?

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

 *  Thread Starter [MacGyver_](https://wordpress.org/support/users/macgyver_/)
 * (@macgyver_)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/replace-standard-wordpress-search-by-custom-sql-query/#post-2867012)
 * Or is it possible to create a query filter and JOIN a table (INNER join) ??
 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/replace-standard-wordpress-search-by-custom-sql-query/#post-2867045)
 * You can hook the filter ‘posts_search’, I’m not sure how use it though. Alternately,
   you can either replace your theme’s searchform.php, or put your’s in a child 
   theme, or hook the filter ‘get_search_form’, where your new search form action
   points to your own search handler page.
 * There are a few extended search plugins. You could peek at their code for other
   ideas, or just use one of the plugins instead of rolling your own.

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

The topic ‘Replace standard WordPress search by custom SQL query’ is closed to new
replies.

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 2 replies
 * 2 participants
 * Last reply from: [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Last activity: [13 years, 10 months ago](https://wordpress.org/support/topic/replace-standard-wordpress-search-by-custom-sql-query/#post-2867045)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
