Title: Automatic Filter
Author: Tobias Bäthge
Published: December 1, 2022
Last modified: May 14, 2025

---

Pre-filter a table with a configured search term!

# 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](https://tablepress.org/modules/row-filtering/)
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 Name | First Name | Birthday | Company |  
   |  Banks | Travis | 05/04/1969 | Apple |

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:

 * [Apple](https://tablepress.org/modules/datatables-auto-filter/?company=Apple#feature-description)
 * [Google](https://tablepress.org/modules/datatables-auto-filter/?company=Google#feature-description)
 * [IBM](https://tablepress.org/modules/datatables-auto-filter/?company=IBM#feature-description)

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

[Use this feature with a TablePress Premium plan today](https://tablepress.org/pricing/?company=IBM&output_format=md)

## 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.

![Screenshot of the available settings for the "Automatic Filtering" module in the"
Settings" sidebar of the "TablePress table" block.](https://tablepress.org/wp-content/
uploads/2024/11/datatables-auto-filter-block.png)

The available settings for the “Automatic Filtering” module in the “Settings” sidebar
of the “TablePress table” block.

Alternatively, use the Shortcode

    ```language-plaintext
    [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

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

to enable URLs like

    ```language-plaintext
    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](https://tablepress.org/faq/configuration-parameter-reference/)
in the “TablePress Table” [block](https://tablepress.org/faq/documentation-tablepress-table-block/),
the Elementor widget, or in the [Shortcode](https://tablepress.org/faq/documentation-shortcode-table/)
that you are using to embed the table:

  |  Module | Slug |  | Configuration parameter | Name | Description | Type | Default value |  
   |  Automatic Filter | datatables-auto-filter |  | datatables_auto_filter | Automatic Filtering Search Term | The table will be automatically filtered for this search term. | string | `""` (empty string) |  
 |  Automatic Filter | datatables-auto-filter |  | datatables_auto_filter_url_parameter | Automatic Filtering | Instead of, or in addition to, using a pre-defined search term, a URL parameter like “table_filter” can be used. | string | `""` (empty string) |

The “Automatic Filter” feature module is part of the [**TablePress Premium plans**](https://tablepress.org/pricing/?company=IBM&output_format=md).

**On this page**

 1. [Feature description](https://tablepress.org/modules/datatables-auto-filter/#feature-description)
 2. [Usage instructions](https://tablepress.org/modules/datatables-auto-filter/#instructions)
 3. [Configuration parameters](https://tablepress.org/modules/datatables-auto-filter/#configuration)