Title: Auto search via query string
Last modified: December 8, 2017

---

# Auto search via query string

 *  [Mike Rodriguez](https://wordpress.org/support/users/iammikerodriguez/)
 * (@iammikerodriguez)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/auto-search-via-query-string/)
 * I was wondering if its possible to trigger the search action via query string
   and it search for the location, rather then just populate it in the search bar
   and the user will still have to hit “search”
 *     ```
       function wpsl_custom_search_input() {
           $search = isset( $_REQUEST['locate'] ) ? ( esc_attr( $_REQUEST['locate'] ) ) : '';
           return $search;
       }
       add_filter( 'wpsl_search_input', 'wpsl_custom_search_input' );
       ```
   
 * Search will automatically initiate when [http://domain.com/?locate=zipcode](http://domain.com/?locate=zipcode)
 * Reference this thread: [https://wordpress.org/support/topic/can-i-pass-the-zip-code-using-url-parameters/](https://wordpress.org/support/topic/can-i-pass-the-zip-code-using-url-parameters/)

The topic ‘Auto search via query string’ is closed to new replies.

 * ![](https://ps.w.org/wp-store-locator/assets/icon-256x256.jpg?rev=1007784)
 * [WP Store Locator](https://wordpress.org/plugins/wp-store-locator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-store-locator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-store-locator/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-store-locator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-store-locator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-store-locator/reviews/)

## Tags

 * [javascript](https://wordpress.org/support/topic-tag/javascript/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * 0 replies
 * 1 participant
 * Last reply from: [Mike Rodriguez](https://wordpress.org/support/users/iammikerodriguez/)
 * Last activity: [8 years, 5 months ago](https://wordpress.org/support/topic/auto-search-via-query-string/)
 * Status: not resolved