Title: search_form_args
Published: May 7, 2019
Last modified: May 20, 2026

---

# apply_filters( ‘search_form_args’, array $args )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/hooks/search_form_args/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/search_form_args/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/search_form_args/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/search_form_args/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/hooks/search_form_args/?output_format=md#wp--skip-link--target)

Filters the array of arguments used when generating the search form.

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/search_form_args/?output_format=md#parameters)󠁿

 `$args`array

The array of arguments for building the search form.
 See [get_search_form()](https://developer.wordpress.org/reference/functions/get_search_form/)
for information on accepted arguments.

More Arguments from get_search_form( … $args )

Array of display arguments.

 * `echo` bool
 * Whether to echo or return the form. Default true.
 * `aria_label` string
 * ARIA label for the search form. Useful to distinguish multiple search forms on
   the same page and improve accessibility.

## 󠀁[Source](https://developer.wordpress.org/reference/hooks/search_form_args/?output_format=md#source)󠁿

    ```php
    $args = apply_filters( 'search_form_args', $args );
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/general-template.php#L286)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/general-template.php#L286-L286)

## 󠀁[Related](https://developer.wordpress.org/reference/hooks/search_form_args/?output_format=md#related)󠁿

| Used by | Description | 
| [get_search_form()](https://developer.wordpress.org/reference/functions/get_search_form/)`wp-includes/general-template.php` |

Displays search form.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/search_form_args/?output_format=md#changelog)󠁿

| Version | Description | 
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fsearch_form_args%2F)
before being able to contribute a note or feedback.