1

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

get_search_form()

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

1
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, privacy policy and cookie policy

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