# asp\_only\_keyword\_results

<figure><img src="/files/E6bijLi3qcJqSE6rq3VW" alt=""><figcaption><p>Keyword Suggestions for no results</p></figcaption></figure>

Gives access the keyword suggestions array before sending it to the templating system. Different from [asp\_results](/hooks/filters/search-results/asp_results.md), as this is only applied in ajax context, when **no results** were found, and the keyword suggestions are enabled.

```php
apply_filters('asp_only_keyword_results', $data);
```

### Parameters

* **$data**(array) - Array containing the keyword data

### Usage

```php
add_filter( 'asp_only_keyword_results', 'asp_custom_keyword_results', 10, 4 );
function asp_custom_keyword_results( $data ) {
    $data['keywords'] = array('keyword 1', 'keyword 2', 'keyword 3');
    return $data;
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://knowledgebase.ajaxsearchpro.com/hooks/filters/search-results/asp_only_keyword_results.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
