Advance WP Query Search Filter

Finally the new wp query search filter is released! Known as Advance WP Query Search Filter, it added many new features in the plugin. In nutshell Advance WP_Query Search Filter let your user perform more precisely search by filtering the search through post type, taxonomy and meta field. Ideal for website that have multiple post types, taxonomies and meta fields, eg property website, product website etc.


Plugin Features:

  • Admin are free to choose whether the search go through post type, taxonomy, meta field or even all of them.
  • Multiple Search Form Supported.
  • Search form now support checkbox,radio and dropdown fields.
  • Using wp search template to disply the result.
  • Admin can define how many result per page.
  • Admin can sorting the result page by meta key and meta value.
  • Using shorctode to display the search form.
  • Generate meta value by a click


  1. Upload `advance-wqsf` folder to the `/wp-content/plugins/` directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Create your search form in the Advance WQSF.
  4. Using `[awsqf-form id={form id}]` to display the form.


How can I styling the search form?
You can simply refer the awqsf-style.css.css that come with the folder and alter it or override it at your theme css file.

What if I want to display the search form in the template?
Put this into `<?php echo do_shortcode(“[awsqf-form id={form id}]”); ?>` your template.

What if I want to display the search form in the sidebar widget?
Just insert the shortcodes like you inserted in the post content. eg. ‘[awsqf-form id=3299]`

What if I don’t want to display the title of the search form?
Just giving `0` to `formtitle` atribute in the shortcode eg. ‘[awsqf-form id=3299 formtitle=”0″]`

How to customize the search query (normally the text in search for in search template) ?
You can use `awqsf_search_query` filter to customize the search query to fit your need. eg

add_filter('awqsf_search_query', 'my_search_var');
function my_search_var($s){
if(isset($_GET['cmf']) || isset($_GET['taxo'])){
if(isset($_GET['cmf']) ){
 	 $cmfterms = $_GET['cmf'];$sterm = '';
	foreach( $cmfterms as $v){
	if(isset($v['value']) && $v['value'] !='wqsfcmfall')
	//exclude 'all text' in custom meta field. You can use to display it with other text you like by responding the meta key. exp if($v['value'] =='wqsfcmfall' && $v[metakey] == 'responding meta key'){$sterm[] = 'All price' ; }
	 {$sterm = $v['value'];}
	$searchterm1 =  implode(",", $sterm);//you can implode with your value as well. But this applied with all values (including null value) 
	}else{$searchterm1 = $sterm;}

if(isset($_GET['taxo']) ){
 	 $taxterms = $_GET['taxo'];$sterm2 = '';
	foreach( $taxterms as $v){
	if(isset($v['term']) && $v['term'] !='wqsftaxoall')//exclude 'all text' in taxonomy term.  You can use to display it with other text you like by responding the taxonomy. exp if($v['term'] =='wqsfcmfall' && $v['name'] == 'responding meta key'){$sterm[] = 'All cities' ; }
	 {$sterm2 = $v['term'];}
	$searchterm2 =  implode(",", $sterm2);}//you can implode with your value as well. But this applied with all values (including null value) 
	else{$searchterm2 = $sterm2;}


$query = $searchterm1.' '.$searchterm2.' ';
elseif(isset($_GET['s'])){ // this line for text search query

 $query = get_query_var( 's' );

      $query = esc_attr( $query );

return $query;


You can download Advance WP Query Search Filter at here:

Download Advance WP Query Search Filter

Notice :  If you now using my old WP Query Search Filter plugin, please deactivate/uninstall it before using this plugin.

Version 1.0.8 UPDATE NOTE:
In version 1.0.8, I added two action hooks in the search form – awqsf_fhead() and awqsf_fbottom(). Now you can add more field in the search form easily. 🙂

[h5-donation id=”1″ ]

Notice: Now the comment area has been closed. Please use our new support forum to post your question. Thanks!

Visit Advance WP Query Search Filter Support Forum

Join the Forum discussion on this post

81 thoughts on “Advance WP Query Search Filter

  1. Yebo

    Looking Good, Just investigated setting up a website with custom fields and custom post types. The only thing holding me back was a proper search. This plugin looks like it is going todo the trick. Maybe you can look into other thing (not needed for my purpose currently but can be handy for property websites. Maybe if people filter for lets say bedrooms and they select 3 that it automatically shows posts which have 3 bedrooms or more

    1. tck30

      Yes, you can do that by defined the bedrooms comparator to >= (Greater than or equal to ) (assuming that bedrooms is meta field ).

      1. Yebo

        Cool will try it out, currently busy with another project which does not require search but when I have time I will look into this plugin a bit more and discover all the posibilties.

  2. Duncan

    Is it possible to create a results page? I would like to use this to show a list of custom post types but do not want it to use the default search page.

    1. tck30

      Yes, you can. You can manipulate the search.php file.
      Put this in the loop:

      if(wp_verify_nonce($_GET[‘s’], ‘awqsfsearch’) ){ // checking if the search is from this plugin
      include template.php ;//customize the search result or include your custom template }
      else {
      do your default search template.

      1. Andy

        Thanks for a great plugin.

        I’m also trying to create a results page. I copied the code above into search.php, but I am getting a syntax error no matter where I place it.

        I’m using the standard twentyeleven theme. Any suggestions where I might be going wrong?

        1. tck30

          Try this

          if(isset($_GET['wqsfsubmit']) && $_GET['wqsfsubmit']=='Search') {
          include template.php ;//customize the search result or include your custom template
          do your default search template.

  3. Lucas

    Is it possible to display two or more combo boxes in a single line?

    1. tck30

      What do you mean combo boxes in a single line? Is that the way to display the search input?

  4. Silas

    Is there anyway I can add a search bar to filter through first names, last names etc. I am going to have thousands of profiles i need to search through on my website…

    1. tck30

      Do you mean you want to search through your site user? If so, this plugin doesn’t support that.


    It’s Great plugin .. Thanks

    But there is one problem (WordPress Version 3.5.1)

    when i activated the plugin, there was a title issue at home page , categories and posts

    this issue can effect site SEO

    please check it 🙂

    1. tck30

      Thanks for pointing it out, now already fixed in version 1.0.3 version!

  6. klewis

    Is there a way to filter the search results? Example.. Chose Meta tag 1 (State in this Case)… Then show only posts with Meta tag 2 (Cities within That state)

    1. tck30

      Well, it depends. For example, for state-city relationship. 1 city only assigned to 1 state, thus if you choose state, then all post with state meta will be displayed. This will include all the posts with the city within state. However, if relationship like student – hobby. A student can be more than one hobby (sport, music, reading), then if choose student meta field, then all the post with sport, music and reading with be shown.

  7. Chris

    I want to do prices and have them display like £10,000 how is this done. I cant seem to get that working.
    Mainly as the separator for taxonomies and custom fields is a comma. Hope I am making sense.

    1. tck30

      Well,I don’t know how you store your price. If you store your price with 10000, then you should use that in the search form, without the “£” and “,”.

  8. DT

    <q cite="What if I want to display the search form in the template?
    Put this into your template.”>

    Hi think there is a missing ] in this part from the documentation ? Great plugin so far am testing it right now.

    1. tck30

      Fixed it, thanks for pointing it out.

  9. alanna

    okay this was probably already answered
    but i jsut want a simple search to find posts of a specific title and if they don’t type it right that it spits out a message saying file not found, would you liek to rety or something similar i don’t want it to list everything in my site. cause somethings are for members only.

    please? tell me how great guru.


    1. alanna

      wants to feel special is why i asked.

    2. tck30

      Not quite sure what you want to do.
      Are you using the string search only?

      they don’t type it right that it spits out a message saying file not found

      What do you mean spits out a message saying file not found?Is it a pop up? Or just the result page. If it is the latter then it should be already included in your search.php template.

      If you want the search exclude posts from members, do you have particular taxonomy/term for your member’s post? If you do, then it would be easier to exclude that term from the search. If you don’t, then maybe it can be done by editing the plugin files (not recommended though).

      Hope that I understand your question right.

      1. alanna

        yes using search string i only want the results page to show an answer if the exact search string is found. if blank, then i want a no results page.

        begin search>
        if search $= empy or = to 0 then go to no results
        if search$>< exact name go to no results page

        only if search $ = "" then goto page
        otherwise go to no results page

        have not tried the taxonomy as that is new for me to wrap my mind around.

  10. alanna

    “” meaning exact search string

  11. 9-sec » WP Query Search Filter

    […] 2 : The Advance WP Query Search Filter has been released! This old  WP Query Search Filter will not update any […]

  12. Master K

    Is it possible to have multiple dropdowns that modify each other. For example:

    I am using custom taxonomies and meta-data to enter products in a site.

    If I am selling tables…
    First dropdown shows Colors available.
    if Black is chosen then second dropdown changes to show only the styles available in black, like round and rectangle.
    Then based on that the third option refines to only show item option that match the first two. So the third dropdown might then only show Oak and Glass.

    As each option is chosen the listing on the page would change.

    Can your plugin allow that type of drill down?

    1. tck30

      what you meant is dependent dropdown field. Unfortunately, this plugin doesn’t support that. What you want is heavily relied on javascript and ajax, it will be easy if it is custom made.

  13. Marjorie


    I am working on a new portfolio and I’d like to be able to filter my projects via 3 different taxonomies. (device, domain, services).
    I would like to be able to click on the name of the filter to activate or desactivate it. It means, no more radio button, and no more search button…
    That way when I chose a filter, the result underneath update right away.

    Is there an easy way to do that.

    1. tck30

      Currently the support doesn’t support this. Maybe soon I will come out plugin that for this feature.

  14. Steven Slack

    I am running wp_debug on my local server and I am getting all kinds of errors and warnings. On the front end when I preform a search I get this return multiple times:

    Undefined variable: searchterm1 in /~~~~~/wp-content/plugins/advance-wp-query-search-filter/includes/process.php on line 198

    On the admin side if I save a custom search I get this error:

    Notice: Undefined variable: post_id in /~~~~~/wp-content/plugins/advance-wp-query-search-filter/advance-wp-sf2.php on line 253

    Notice: Undefined variable: post_id in /~~~~~/wp-content/plugins/advance-wp-query-search-filter/advance-wp-sf2.php on line 254

    Notice: Undefined variable: post_id in /~~~~~/wp-content/plugins/advance-wp-query-search-filter/advance-wp-sf2.php on line 255

    Notice: Undefined variable: post_id in /~~~~~/wp-content/plugins/advance-wp-query-search-filter/advance-wp-sf2.php on line 256

    Warning: Cannot modify header information – headers already sent by (output started at /~~~~~/wp-content/plugins/advance-wp-query-search-filter/advance-wp-sf2.php:253) in /~~~~~/wp-includes/pluggable.php on line 876

    This returns a blank screen. Are you debugging this plugin with proper WordPress debugging practices?

    Let me know if you get these issues resolved.


    1. tck30

      The warning (Undefined variable: searchterm1) will be solved by the next release.
      However, the other error seem is weird, Never met this before. Maybe the file was incomplete downloaded? Try download/install again. Let me know if it is still not working.

      1. Steven Slack

        Wow! Thanks for responding and the latest update fixed the first error. I am still getting the same errors in debug mode on the admin side when I save the settings.

      2. Steven Slack

        I also think it is worth mentioning that I am working on a localhost in MAMP and I have a multisite installation.

        1. tck30

          I never try it on multisite, maybe this is the reason why it doesn’t working.

          When you on the form edit page (not create new form), do you see something like this
          wp-admin/?page=awqsf&formid=5&formaction=edit ?

          1. Steven Slack

            I am seeing the following when I am creating a new form:


            I also am using the default twentytwelve theme and I have no other plugins installed. I’ll run the latest version on my live hosting environment and see if I get the same errors.

          2. Steven Slack

            When I am saving a new form I do not get the error. WHen I am editing I get the error. Here is the URL that I see:


          3. tck30

            It supposed not act like this. Can you try on the single wp installation to see if the error still exist?

      3. Steven Slack

        Still getting this error on a single install with wp_debug set to true

        Notice: Undefined variable: post_id in /wp-content/plugins/advance-wp-query-search-filter/advance-wp-sf2.php on line 253

        Notice: Undefined variable: post_id in /wp-content/plugins/advance-wp-query-search-filter/advance-wp-sf2.php on line 254

        Notice: Undefined variable: post_id in /wp-content/plugins/advance-wp-query-search-filter/advance-wp-sf2.php on line 255

        Notice: Undefined variable: post_id in /wp-content/plugins/advance-wp-query-search-filter/advance-wp-sf2.php on line 256

        Warning: Cannot modify header information – headers already sent by (output started at /wp-content/plugins/advance-wp-query-search-filter/advance-wp-sf2.php:253) in /wp-includes/pluggable.php on line 877

        1. tck30

          Hi,try the latest 1.0.7 version. Let me know if it is working.

          1. Steven Slack

            It Worked!!! I am dropping you a donation and giving your plugin a good rating on the repository for such great support. Thanks!!

  15. Artur Wow


    Can you perform an implementation of “JQuery Range Slider” to be used with BETWEEN (or another sectors)?

    NOTE: To be clear, “range slider” can be found in:
    AND founded on (grounded):

    Your work will get the “Perfect” Status if it happens 🙂

    (I don’t know why you did not use this desired and modern feature; Anyway, the sugestion is here).

    Going to the perfection,
    many thanks!

    Sorry for my english’s knowledge;
    I prefer the perfect: portuguese.

    1. tck30

      Actually it is already in my mind. Thinking make it into a javascript and ajax version of this plugin.

      But still, thanks for the suggestion.

  16. Maher

    I made the form to search for categories but in result it displays nothing. any recommandation or help. here is the link for the site and the form is in the right below.
    You can make a try and tell me wht’s the problem.

    1. tck30

      It probably is you made some wrong setting. From I what saw on you website, you have ad_cat, ad_location and ad_tag for the search, Are these taxonomy ? Or it is just catagory?

      1. Maher

        Thanks for reply .
        please see the picture in the link :

        1. tck30

          Weird, seem you got everything correctly. Can’t tell what is the problem, possibility are plugin conflict or theme compatibility issue.

  17. Debbie

    Thank you so much for this plugin! It is absolutely brilliant. I will be making a donation in the near future by God’s grace.


  18. John

    I tried to add new search filter with custom meta fields, but got only a button on front page.
    How to solve the problem?


    1. tck30

      Have save the form setting page after adding custom meta fields?

      1. John

        No. I save the form setting page with fields.

        1. tck30

          Have you add the display type (dropdown, checkbox, or radio) for each field in the stting page?

          1. John

            No. This types don’t suit me. Have a text type in plugin?

          2. tck30

            That’s why it doesn’t show anything on the search form.
            No, by default the plugin doesn’t support text field.

          3. John

            Too bad! Can you advise the plugin that supports?

          4. tck30

            No, i don’t know any plugin that supports this. However, I have made a custom version of this plugin to my client including this feature.

          5. John

            Great! When can we expect it?

          6. tck30

            For some reason, I will not include this feature in near future.

  19. Brad Snyder

    I’m using your latest plugin with the Max Magazine theme. I want to have the search form search posts only on this page: … I’ve placed the short code into the posts page, but I cannot get the form to display. I do receive a message at the top of the page “Please enable theme settings from the theme options” but I cannot find any place to enable any other settings.

    Also of note, the plugin does seem to work as a widget.

    Any thoughts?



    1. tck30

      I don’t sure what’s your problem, but mostly is the problem is caused by the theme.

      “Please enable theme settings from the theme options” this indicate that your theme need some setting. Consult with your theme developer regarding this problem.

      And no, the plugin doesn’t work as widget, but you can use the shortcode in the the theme text widget.

  20. Steven Slack

    OK – So I am noticing that when I do a keyword search with the plugin I am not getting the search result in the title. I have tested it with several themes including TwentyTwelve. Most search terms get displayed with get_search_query(); Any insights into this issue?

    I have also tried to highlight search terms with several other plugins and none work with this plugin.

    Any insights would be helpful.

    1. tck30

      Are you refer to page title? If yes, the plugin have a filter for it – awqsf_search_title() . basically it is like wp_title filter where you can change the page title you like.

  21. ApuestoKid

    Hello!! I’m using your plugin and it’s awesome, but I don’t know if there is an easy way to get all the search “terms”.

    I’ve created a search page, and i want to make in the search loop the “else” conditional for if there’s no results.

    I would like to put something like “nothing found with the words: “thewords” and the categories “thechoosencategories”, etc…..
    Is there any way, shortcode, function or something that list all the search criteria?
    Thanks in advance!!

    1. tck30

      Yes, you can. Please refer to awqsf_search_query filter,see the example in the post above.

  22. Steven Slack

    Hello, I am having fun customizing your search plugin. Please take a look here: I have created a custom post type with several taxonomies. I have noticed that if I do a keyword search for one of the taxonomies I do not get a return. We are afraid the user will enter a keyword over using the search filter and we want to make sure this covers all of our grounds.

    Thoughts on this?

    1. tck30

      The keyword search will only go through post title and post content. When user search by keyword, the taxonomy (and custom post type) will be ignored. So in your case, if you want the user search the taxonomy by entering keyword, then you should add those taxonomy’s term in your post content.

    2. Sandeep

      What a cool interface @Steven Slack. could you plz share the css? how could you made this? it looks so cool.

  23. Mel (My Style Craving)

    I’m trying to implement this on a standalone page, but searching 4 taxonomies makes it a very long form. Can you explain how I should customise the css so either checkboxes display in a row left to right below the heading or so the search form has several columns?
    Thank you!

    1. tck30

      Please refer to the advance-wp-query-search-filter/css/awqsf-style.css .

      You can try this for checkboxes to display in line:

      label.taxcheckbox, label.cmfcheckbox{float:left;width:100px;}

      Play around with it, eventually you will know how to customize the styling.

  24. Jon

    I’d like to be able to search taxonomy, custom fields AND a search term. It seems like that should be possible… can you help?

    1. tck30

      Please refer to this thread

  25. Ryan

    What would be required to make the dropdown search fields use conditional logic. Eg. If you select taxonomy dropdown “Canada” then it shows a dropdown of “canadian cities.” Thanks for the plugin, btw.

    1. tck30

      Unfortunately there are no easy ways to do this.

  26. Swetha


    Can this plugin help me create search areas like on this website

    In short it should fetch the details of the registered users in the website.
    Kindly advice.

    1. tck30

      No it can,t, it only search for posts. But if your users registered under post type, and yes it can.

  27. 9-sec » Ajax WP Query Search Filter

    […] wordpress search plugin.  As the name suggested, it is pretty much similar to my previous plugin Advance WP Query Search Filter which, let you perform more precisely search by filtering the search through post type, taxonomy […]

  28. Ben

    Hey, great plugin so far. I am trying to set it up to do an AND search rather than an OR when two or more custom taxonomy fields are selected, but it seems to be ignoring the boolean part. For example, if I search for something which only has alloy wheels but not air conditioning, but I tick both checkboxes on the form, it still returns the result, when I think it shouldn’t, as the item doesn’t have both features? Is there any way I can check on what is happening please?

    Thanks for your help in advance!

  29. tck30

    Is your alloy wheels and air conditioning is in same taxonomy?

  30. Andy Ward

    Hi there I have recently implemented your ‘Advance WP Query Search Filter’ plug in to the following website
    It works great but I have an issue whereby it doesn’t leave displayed the choice that users have made when viewed on a PC (or Firefox on Mac)
    I have tried edited the css file to no avail ?!?!?!

    Can you help ?

  31. Marie LaForte

    I am developing a site and have installed the ajax version search. I am trying to get one of the meta value fields to display on the search results page…just don’t know how. The value is price and it is one of the search values on the form. I have tried many different ways of adding the meta value on the process.php page but it won’t display the price. I am not a programmer and have tried to copy other php code from the web and the jigoshop code(that is what I am using to display the properties on this site. I was ale to add post values to the search result but no meta values. Can anyone help??
    Thanks in advance,

    1. tck30

      You shouldn’t asking at here, this is for Advance WP Query Search Filter, not Ajax WP Query Search Filter. Please go to here to leave your comment.

  32. Advance WP Query Search Filter | WP Plugin Directory

    […] If you have any problems with current plugin, please leave a message on Forums Posts or goto Here. […]

Comments are closed.