apply_filters( ‘search_form_format’, string $format, array $args )

Filters the HTML format of the search form.


The type of markup to use in the search form.
Accepts 'html5', 'xhtml'.
The array of arguments for building the search form.
See 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.

More Information

The filter function must return a $format value after it is finished processing or the search form will be empty.


$format = apply_filters( 'search_form_format', $format, $args );


5.5.0The $args parameter was added.

User Contributed Notes

You must log in before being able to contribute a note or feedback.