> For the complete documentation index, see [llms.txt](https://knowledgebase.ajaxsearchpro.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://knowledgebase.ajaxsearchpro.com/hooks/filters/query-and-output/asp_print_search_query.md).

# asp\_print\_search\_query

Allows changing the value (search query) before printed to the search input field on the search results page

![](https://1744076133-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M9rmHbZfTKVQ7YzbIZL%2F-Ml8v6FDXXIgptqgP8MZ%2F-Ml8vaLiUsHLD53HPLr2%2Fimage.png?alt=media\&token=75d35c18-9499-44ca-921a-a03141abfd66)

### Parameters

* **$query**(string) - The search query string
* **$id** (int) - Search instance ID

### Usage

```php
add_filter("asp_print_search_query", "asp_change_print_search_query", 10, 2);

function asp_change_print_search_query($query, $search_id) {
  // Do whatever with the query
  return $query;
}
```
