Automatic Filter

Sometimes it can be useful to initialize the “Search” field above a table with a filter word, for example to highlight a certain row in a table. The advantage of this method over the Row Filtering module is that the visitor can change the filter word, to e.g. see all entries in the table.

Feature description

Here is an example with a pre-filled Search field, a company name:

Last NameFirst NameBirthdayCompany
BanksTravis05/04/1969Apple

If you reload this page via these links, you will see how a different company is used for the pre-filtering, thanks to the company URL parameter that was configured for this:

This, for example, allows sending prepared URLs to site users, so that they will directly see desired search results.

Usage instructions

To use these features with your tables, activate the “Automatic Filter” feature module on the “Modules” screen of TablePress Pro or TablePress Max. Then, configure the desired options in the “Automatic Filtering” section of the “Settings” sidebar of the table’s “TablePress table” block when editing the post or page with the table, or use the configuration parameters from below.

Alternatively, use the Shortcode

[table id=123 datatables_auto_filter=test /]Code language: plaintext (plaintext)

to have the table filtered for test when the page is loaded. Change the 123 to your table’s ID.

Or, you could use

[table id=123 datatables_auto_filter_url_parameter=table_filter /]Code language: plaintext (plaintext)

to enable URLs like

https://example.com/page-with-table/?table_filter=wordCode language: plaintext (plaintext)

so that the filter term will be extracted from the URL parameter table_filter.

Configuration parameters

To configure this module’s features, you can also use these configuration parameters in the “TablePress Table” block, the Elementor widget, or in the Shortcode that you are using to embed the table:

ModuleSlugConfiguration parameterNameDescriptionTypeDefault value
Automatic Filterdatatables-auto-filterdatatables_auto_filterstring"" (empty string)
Automatic Filterdatatables-auto-filterdatatables_auto_filter_url_parameterstring"" (empty string)