Our Biggest Sale Is Here
Up to 70% Off
Get the Deal

How to add column filters to a table in wpDataTables

Say your car catalog has 300 cars, and visitors want only SUVs from Toyota or Honda that cost between 20,000 and 30,000 EUR. One search box can’t do that. Column filters give each column its own filter, such as a dropdown for the brand, checkboxes for the body type and a from-to range for the price, and visitors combine them to narrow the table down. You can add filters with Tabella AI or in the column settings.

How do I add a filter with Tabella AI?

Open the table, click Ask Tabella AI and name the column and the kind of filter.

  1. Open the table. Go to wpDataTables → wpDataTables and click the table title.
  2. Ask Tabella AI. Click Ask Tabella AI and type, for example: Add a dropdown filter to the Status column. Ask for one filter per message.
  3. Check and save. Read the reply of Tabella AI and check the preview. Click Save Changes to keep the filter, or Undo table changes to go back.
Tabella AI side panel in the wpDataTables editor after the request to add a dropdown filter to the Status column, with the list of changes it made
Tabella AI after your request: (1) the request you typed, (2) the list of changes, (3) the Status column, which gets the new dropdown filter after you click Save Changes.

Video: adding a Status filter with Tabella AI.

How do I add a filter in the column settings?

Turn on column filters for the table, then choose a filter type for each column in its Filtering tab.

  1. Open the table. Go to wpDataTables → wpDataTables and click the table title.
  2. Turn on column filters. In the Sorting and filtering tab of the table settings, turn on Advanced column filters.
  3. Open the column settings. In the table preview, click the settings icon in the header of the column you want to filter.
  4. Choose the filter type. In the Filtering tab, make sure Allow filtering is on under Add a filter for this column, and pick a Filter type, for example Selectbox.
  5. Save the table. Click Save Changes. Repeat for other columns.
The Filtering tab of the Category column in wpDataTables with Allow filtering on, Filter type set to Selectbox and the list of filter types open
Column filter settings: (1) the Filtering tab, (2) Allow filtering, (3) the Filter type list, (4) Save Changes.

To keep a column out of the filters, turn off Allow filtering for it. To keep it out of the main search box above the table, turn off Enable this column in Global search in the same tab.

Which filter type should I use?

Pick the filter type by what visitors look for and by the column type:

Filter type What visitors do Use it for
Text Type part of a value. “na” finds Barcelona and Punta Cana. Names, cities, any text
Number Type a number. Only rows with exactly that number show. Codes, IDs, years
Number range Enter a from and a to value; both limits are included. Turn on Number range slider under Range slider to show a slider instead. Prices, quantities
Date range, DateTime range, Time range Pick a from and a to date, date and time, or time. Date, DateTime and Time columns
Selectbox Choose one value from a dropdown. Columns with a few repeating values, such as a status
Multiselectbox Choose several values from a dropdown. Brands, categories
Checkbox Check several values in a list, or in a pop-up opened by a button. Short lists, such as continents

Filters work together: a visitor who picks Toyota and Honda in the brand filter and 20,000 to 30,000 in the price filter sees only rows that match both.

How do I set the values of a dropdown or checkbox filter?

By default, Selectbox, Multiselectbox and Checkbox filters list the values found in the column. To set your own list or order, open the Data tab of the column, set Possible values for column to Define values list, and click Read from table or type the values in Values list, for example Apple, Peach, Lemon, Orange. The same list is used by the editor in editable tables.

To add a search field to a Selectbox or Multiselectbox filter, turn on Enable search in selectbox/multiselectbox in the Filtering tab. Multiselectbox and Checkbox filters can also use AND logic, so a row must contain all selected values, not just one of them.

How do I make a filter match exactly?

Turn on Enable exact filtering under Exact filtering in the Filtering tab of the column. Without it, choosing “Room 1” also finds Room 10 and Room 12, because they contain “Room 1”.

How do I show filters in a form above the table or in a sidebar?

Turn on Filters in form in the Sorting and filtering tab, and the filters move from the column headers into a form above the table. This helps when the table has many columns, and it also lets you filter by columns that are hidden from visitors. With Render in modal on in a column’s Filtering tab, a checkbox filter shows as a button that opens the checkbox list.

To put the form in a sidebar instead, keep Filters in form on, add the table to a page that has a sidebar, and drag the wpDataTables filtering widget to that sidebar in Appearance → Widgets.

Turn on Clear filters button in the same tab to give visitors one button that resets all filters. It shows after the last filter in the form, or above the table next to the table tools.

How do I open the table with filters already set?

Enter a value in Predefined value(s) in the column’s Filtering tab, and the table opens filtered by it. For dropdown and checkbox filters you pick the values from the list, which shows Nothing selected until you do. You can also use placeholders such as %CURRENT_USER_ID% or %VAR1%, described in Table placeholders, and you can set filter values in a link, as described in Pre-filtering a table through the URL.

  • The number range slider is not available with cascade filtering from the Powerful Filters add-on or for server-side Gravity Forms tables.
  • Filters on hidden columns work only in the filter form or the widget, and many hidden columns slow down the page.

What should I remember about column filters?

Ask Tabella AI for one filter at a time, or turn on Advanced column filters for the table and pick a Filter type in each column’s Filtering tab. Use ranges for numbers and dates, dropdowns or checkboxes for repeating values, and Exact filtering when partial matches get in the way. Move the filters into a form or a sidebar widget for wide tables, and set default values to open the table already filtered.

Wait, Before You Download!

To get your hands on wpDataTables Lite, please enter your email address below. We’ll send you a direct download link and keep you updated on existing features along with helpful tips and tricks!

By continuing, I accept Privacy Policy and T&C
Mail Box