You don’t need searchform.php

Searchform.php is only needed if you are actually making changes to the default search form.

While reviewing themes submitted to, I often notice that authors are including searchform.php without making any changes compared to the default form.

Other authors are using

add_theme_support( 'html5', array( 'comment-list', 'comment-form', 'search-form', 'gallery', 'caption' ) );

But replacing the search form with a non html5 form. This is unneccesary.

The Developer Code reference on explains how get_search_form() first attempts to locate the searchform.php file in either the child or the parent theme, then load it. If it doesn’t exist, then the default search form will be displayed.


Leave a Reply