Wordpress search with more input fields?

I have this example of working search:

form action="?php echo esc_url(site_url('/')) ; ?" method="get"
   input type="search" name"s"
   input type="submit" value="search"
/form

and this works great, but what I want to archive is to make this search work with two more select boxes:

form action="?php echo esc_url(site_url('/')) ; ?" method="get"
   select name=""
       optionOption one/option
       optionOption one/option
   /select
   select name=""
       optionOption A/option
       optionOption B/option
   /select
   input type="search" name"s"
   input type="submit" value="search"
/form

How do I go around to make this post do something like this: mysiteDOTcom/s=option1+optionb+searchinput ? Thanks in advance

Topic input forms Wordpress search

Category Web


Sorry, it's unclear to me what your goal is, if you could clarify your question more and additional information like what kind of options you're trying to use (are they custom fields, are they categories, tags, or other taxonomies, or another characteristic like post author?)

First, the select inputs should not have blank name values. (visit this a11y guide page for an example of building a search form with select lists as an example although the example is not specific to WordPress.) Having blank name values usually results in errors in a search form.

(Visit for an example search query How do I properly redirect outbound links with special characters)

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.