> 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/miscellaneous/tutorials/how-to-add-variables-to-the-redirect-to-url-or-the-show-more-url.md).

# How to add variables to the “redirect to url” or the “show more url”?

&#x20;This will only work on plugin version **4.9.5** or later!

Both strings are filtered before output, so you can use a custom function to do the job:

[What is this, and where do I put this custom code?](/safe-coding-guideline.md)\
Change the **$values** array to add/remove query *param=>value* pairs.

```php
// Use this to change the "redirect to url" parameter
add_filter( 'asp_redirect_url', 'asp_add_params_to_url', 1, 10 );
// Use this to change the "show more results url" parameter
add_filter( 'asp_show_more_url', 'asp_add_params_to_url', 1, 10 );

function asp_add_params_to_url( $url ) {
  // Array of param names and values
  $values = array(
    "param1" => "value1",
    "param2" => "value2",
    "param3" => "value3"
  );
  // Merge them together
  foreach ( $values as $k => $v )
    $url .= "&".$k."=".$v;
  
  return $url;
}
```
