Beginner's Guide for WordPress / Start your WordPress Blog in minutes

How to Add Ajax Taxonomies Filter in WordPress Search

We all know that the default WordPress search is not very good. However, if you could allow users to filter results based on categories and tags, custom taxonomies, or post types, then this will help users find content more easily. Previously we showed you how to add this kind of advanced search form in WordPress. In this article, we will show you how to add an Ajax powered taxonomies filter in WordPress search.

Ajax powered search form with taxonomy filters

Why use Ajax Taxonomies Filter in WordPress Search?

Ajax powered search is faster and provides a better user interface. For example, a car dealership website may have custom taxonomies for different vehicle types, price ranges, models, etc. This interface can help users find exactly what they need. It also helps website administrators to organize their content, so that it could be easily found by users.

First thing you need to do is install and activate Ajax WP Query Search Filter plugin. Upon activation, it will add a new menu item “Ajax WPQSF” in your WordPress admin sidebar. Clicking on it will take you to the plugin page where you can click on the Add New Search Form button to build your search form.

Add new Ajax Search Form in WordPress

First you need to provide a title for your form this will be used to recognize your form internally, as you can create multiple search forms with this plugin. After that you can choose post types this search form will look into. You will see the default WordPress posts and pages along with any custom post type you may have on your site.

Ajax search filter settings

Next option is to choose a taxonomy. You can choose the Boolean relationship between taxonomy queries. For example, if a user selects flowers and pets, would you want the plugin to match both terms or display the result if either one of them is found. The next option is to add a taxonomy, to do that you need to click on the Add Taxnomy button.

Adding taxonomies to the Ajax search filter in WordPress

A new popup would appear and you will see category and any other custom taxonomy you may have on your site. You can add a label for the taxonomy. You can choose to hide empty terms. Lastly choose a display type for your taxonomy terms. You can display them in checkboxes, dropdown menu, or radio buttons. After selecting custom taxonomy, you can further fine tune your search form by adding custom meta fields just like you added taxonomy.

The next tab is for result settings and other options. On this tab, you can add a traditional keyword search box and here is the catch. If a user selects a taxonomy or custom meta field and enters the keyword, then the plugin will run search query for the keyword and will ignore taxonomy and custom meta field selection by the user.

Adding a keyword search form in Ajax search

That’s all. Now just save your search form, and you will see a shortcode. You can add this shortcode in any post, page, or text widget on your site to display the search form.

We hope this article helped you add Ajax powered taxonomy filter in WordPress search on your site. Using this advanced search and sorting feature can help you create simple but very efficient sort and search filters on your WordPress site. For questions and feedback please leave a comment below.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit – a collection of WordPress related products and resources that every professional should have!

Reader Interactions

10 CommentsLeave a Reply

  1. Is there anything like this plugin that is currently maintained? This plugin hasn’t been updated in a while.

  2. Can this plugin do search filters for a category, and its children. not sure if I am explaining myself properly. but something along the lines of Country -> State -> City..etc

    Also is it compatible with WPML

  3. Hey, thanks for this! Quick question: I’m having trouble applying jQuery stuff like tooltips to the AJAX content loaded, I guess because it only applies to content loaded upon initial page load. Any ideas on how to make the AJAX content get recognized? Thanks!

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.