Is there any advantage of using default search box with ->


instead of creating the the search form by html forms and wp_query?


1 Answer 1


The big advantage is that it is easy! get_search_form() is only including the file searchform.php of the template. Most of the time it's not more as an simple input field. When the form is submitted search.php is loaded for displaying the found content.

It is possible to modify the search query using an pre_get_post action on the search.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.