You don’t need searchform.php

Breadcrumb Navigation

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

While reviewing themes submitted to WordPress.org, 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 WordPress.org 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.

get_search_form()

Leave a Reply

Your email address will not be published. Required fields are marked *