Does your website store multiple levels of information about documents and files, members, recipes, or anything else? If so, then you might want to add WordPress search filters to help people to find information quickly and easily.
Here’s how dynamic filters – also known as a series of cascading filters – work:
When the user chooses content in one filter, the available options in a second filter update automatically. You can add cascading filters to your blog posts and pages as well as custom post types such as events, recipes, and documents.
In this tutorial, we’ll explain step-by-step how you can add dynamic filters to your WordPress website in a few simple steps.
Why you need a powerful WordPress search filter
If you have lots of information to display on your WordPress site – whether these are blog posts, documents, or custom post types – your users will need a logical way to drill down to find what they’re looking for.
Here’s a real-world example from a customer:
For all projects, I will need to be able to use complex relationships, like for example if I have a plants post type, a compounds post type, and a diseases post type. I will need to be able to find plants that contain a particular compound that is known to remedy a particular disease. I need to be able to set up complex searches like that. Also, it would need to load with AJAX if there will be thousands of plants in the database.
For this, you can use dynamic filter dropdowns that are connected to one another.
Here’s a look at some other WordPress search filter examples for displaying lots of information and why they’re not ideal solutions:
You could create a single filter dropdown which has multiple levels within a single list so that the options from the second filter are indented under the first. This option is available in both our Posts Table Pro and Document Library Pro plugins. It is useful for fairly short lists.
However, if the list is likely to be very long it could potentially cause usability issues. In this scenario, it’s better to have a separate filter for each piece of data so that visitors can drill down one stage at a time.
You could have several standalone filters for documents and files. The problem with this option is that when the user selects a file category, they’ll see all the file tags for all of the file categories in the next filter dropdown.
For example, if they select ‘Research papers’ then they expect the tags filter to update to list the years the research papers were published in instead of each year a document was published. The user would have to go through multiple filter combinations to find documents. No one wants this!
Even if the different pieces of information that you’re allowing users to filter aren’t connected, it’s not ideal if visitors select an item from one filter and the other filters don’t update to show the relevant items.
For example, imagine that you’ve created a WordPress document library and the user selects a document category. They then try to select a document year and end up choosing a year that has no documents from their selected category. It would be better if the year filter had updated to only show years that had documents from the selected category.
Now that we have a better understanding of why traditional WordPress search filter options simply don’t cut it, let’s explore a more viable option.
If you want to add dynamic filters to your WordPress site then you can choose between these plugins:
- Posts Table Pro - Use this plugin if you want to create a filterable list of blog posts, pages or any custom post type (e.g. members or events).
- Document Library Pro - Use this plugin if you want to create a filterable document library.
Both plugins display the information in an AJAX-powered sortable, searchable table layout with dynamic, cascading filters. Users can choose from one WordPress search filter and the contents of the other filters will update automatically.
In addition to this, your site’s users can:
- Use the smart filters to narrow down large volumes of content by categories and taxonomies.
- Use the search tool to quickly find specific content.
- Sort by any column you choose to include in the table including categories and taxonomies.
- Use progressive filters without having to refresh the page thanks to the AJAX based table.
This way, you can empower users to find the exact post or document they’re looking for much faster.
Adding WordPress filter widgets
On their own, the Posts Table Pro and Document Library Pro plugins add AJAX-powered filter dropdowns above the list of items. If you'd like other types of faceted filter - for example filter widgets or checkboxes - then you can use them with the FacetWP plugin.
Together, you can create something like this:
The table is powered by Posts Table Pro/Document Library Pro, and the filters widgets come from FacetWP. The perfect partnership!
When to add dynamic filters to your WordPress website
If your WordPress website contains a large volume of information with multiple types of data, you need a way to display it in a user-friendly way. This way, users can easily find what they’re looking for. One simple way to do this is by adding dynamic filters to your site.
For example, let’s say you have a document library on your WordPress website. You can use WordPress search filter dropdowns to allow visitors to select a category and then a sub-category. Once they do that, they will see the available documents for that sub-category listed in the table. This is also how faceted search works in e-commerce stores.
For example, the different options a user selects might be: Research papers → 2021 → COVID or News articles → 2018 → Winter Olympics.
The best method for displaying this type of information is by creating a series of connected, cascading filter dropdowns.
Here are some examples of use cases that are perfect for using WordPress search filters:
- A directory of consultants based around the world. Let’s say you want to enable users to find a consultant in their particular area. For this, you can create a series of cascading filters that allow users to first select the country, then the area, then the city, and so on. For example, a user might select: USA → California → San Diego to see a list of consultants in San Diego.
- Staff intranet. Suppose your company’s intranet includes content that helps staff carry out their day-to-day tasks and access essential company information such as official documents, company policies, digital assets, information about products and services, and marketing material. You can easily organize all this information using dynamic filters. In this case, the ‘Company Documents’ dropdown would contain all the earlier mentioned essential documents. For example, when an employee selects ‘Marketing material’ from the dropdown filter, the corresponding filter will only show content related to marketing such as sales battlecards, banners, and lead generation strategies.
- Business directory website. If you have an online directory of business listings similar to TripAdvisor or Yelp on your WordPress website, you should use cascading dropdowns to present the available options. This way, you can create a dropdown list containing the user’s location, industries, companies in their area, and services and products.
So, when a user selects a particular industry, for example, ‘Rugs’ then only areas that have stores that sell rugs will be displayed in the next dropdown. As a result, users will be able to quickly search for companies, services, and products in their particular area. It’s a great way to create a search form in WordPress.
How to add dynamic filters to WordPress
Posts Table Pro and Document Library Pro offer a number of options to help you add connected, cascading filters on pages, posts, and custom post types on your WordPress website.
To get started, you’ll need to create a front-end table layout of your documents and files or custom post types. You can add any type of file to it including PDFs.
Step #1: Install the filter plugin
Get the Posts Table Pro or Document Library Pro plugin and install it on your WordPress site. You’ll get a license key in the confirmation email. Paste it in the license key field on the plugin settings page in the WordPress admin.
The settings page also allows you to configure the front-end table layout. Check out the complete documentation for instructions.
Step #2: Add dynamic filters
To add search filters, scroll down to the Table controls section and choose either Show based on columns in table or Custom.
The Show based on columns in table option adds a filter for each relevant column in your table.
The Custom lets you set the exact WordPress search filters you want to display above the table. All you have to do is enter the list of filters in the text box as a comma-separated list. You can filter by categories, tags, and custom taxonomies.
categories,tax:country,tax:locality. In this example, ‘tax:’ is used to specify custom taxonomy filters.
Step #3: Preview
Finally, use the plugin documentation to create a page listing your posts or documents. Preview the page on your site’s front end. It should look something like this:
Users can set the AJAX WordPress search filter dropdowns to quickly narrow down their search. It's the simplest way to set up a powerful search form in WordPress.
Case study: Indiana Broadcasters Association
The Indiana Broadcasters Association uses our Posts Table Pro plugin to list stations in a neat, front-end table layout. The table includes details about each radio station’s title, frequency (channel), city, and phone number. Users can sort the table by title, frequency (channel), or city.
In addition to this, the table has filter dropdowns above it that people can use to quickly find the station they’re looking for by Station Category. The available station categories are Radio and Television. This helps users narrow down their search. Users can also use the search box to find a station in their city, view only AM or FM stations, or search for a specific station by name.
The Indiana Broadcasters Association implements pagination – displaying 25 stations per page – to make it easy for people to browse stations. The station titles aren’t clickable meaning users can’t redirect to a single page from the station directory page.
Learn how to create your own WordPress directory!
The Indiana Broadcasters Association created a custom post type for the stations. They also used the Advanced Custom Fields plugin to add data about each station which is then displayed using the Posts Table Pro plugin.
Set up WordPress search filters today
Adding dynamic filters to WordPress is a great way to enhance the user experience of your website – especially if you need a way to present lots of information in a user-friendly way.
The Posts Table Pro and Document Library Pro plugins enable you to create a series of cascading filters that are perfect for websites containing large volumes of information. These dependent filters will allow users to narrow down their search in a logical way and find what they’re looking for, faster.
Ready to add dynamic filters to your WordPress website? Get the plugin today!