Title: Column filtering
Last modified: August 30, 2016

---

# Column filtering

 *  Resolved [Geoff_A](https://wordpress.org/support/users/geoff_a/)
 * (@geoff_a)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/column-filtering-2/)
 * Hi,
 * I’m trying to make a product comparison table. The problem is that my products
   are listed in the columns, rather than rows. Is there any way to filter columns,
   like with the [row filter extension](https://tablepress.org/extensions/row-filter/)?
   Using show_columns=”3,4″ isn’t ideal, since the column orders may change.
 * Also, it seems show_columns isn’t working with my tables. Here is the shortcode
   I’m using:
 * [table id=1 row_hover=false show_columns=”3,4″ /]
 * Any help would be greatly appreciated.
 * [https://wordpress.org/plugins/tablepress/](https://wordpress.org/plugins/tablepress/)

Viewing 14 replies - 1 through 14 (of 14 total)

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/column-filtering-2/#post-6192680)
 * Hi,
 * thanks for your post, and sorry for the trouble.
 * Unfortunately, I’ll have to disappoint you here. So far, I only developed a Row
   Filter Extension, and due to time constraints don’t have plans to add a Column
   Filtering Extension. Sorry 🙁
 * For that `show_columns` parameter: That works in the opposite way: It will only
   re-show columns that have been hidden before (either via Shortcode or on the “
   Edit” screen). It will however not hide the other columns automatically. So, 
   you might want to try
 *     ```
       [table id=1 row_hover=false hide_columns="all" show_columns="3,4" /]
       ```
   
 * Regards,
    Tobias
 *  Thread Starter [Geoff_A](https://wordpress.org/support/users/geoff_a/)
 * (@geoff_a)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/column-filtering-2/#post-6192768)
 * Tobias,
 * No worries. Thanks for the tip to hide columns. It worked great!
 * Regards,
    Geoff
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/column-filtering-2/#post-6192769)
 * Hi,
 * no problem, you are very welcome! 🙂 Good to hear that this helped!
 * Best wishes,
    Tobias
 * P.S.: In case you haven’t, please [rate TablePress](https://wordpress.org/support/view/plugin-reviews/tablepress)
   here in the plugin directory. Thanks!
 *  [jacessario](https://wordpress.org/support/users/jacessario/)
 * (@jacessario)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/column-filtering-2/#post-6192823)
 * Hello Tobias.
    Thanks for your great plugin. I’m trying to filter columns using
   a command that I saw in another post.
 * “aoColumnDefs”: [{“bSearchable”: false, “aTargets” [1, 2, 3, 4, 5, 6, 7, 8, 9,
   10]}]
 * The problem is that I want this command appears for all tables
    I, without having
   to add on the text box “Custom Commands” from the options on the table. In what
   file and how I can add this command to display default me in all tables? Excuse
   my poor English. Thanks again. Thanks again.
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/column-filtering-2/#post-6192827)
 * Hi,
 * thanks for your post, and sorry for the trouble.
 * The best way to add this to all tables should be with some PHP code that uses
   the available plugin filter hooks.
    For example, please try adding this to the“
   functions.php” file of your theme or a small new plugin file:
 *     ```
       add_filter( 'tablepress_datatables_parameters', 'jacessario_turn_off_ordering', 10, 4 );
       function jacessario_turn_off_ordering( $parameters, $table_id, $html_id, $js_options ) {
         $parameters['columnDefs'] = '"columnDefs": [{"orderable": false, "targets" [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}]';
         return $parameters;
       }
       ```
   
 * Note that this requires that all of your tables have at least 11 columns! Otherwise,
   this will break the JavaScript functions for the tables.
 * Regards,
    Tobias
 *  [jacessario](https://wordpress.org/support/users/jacessario/)
 * (@jacessario)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/column-filtering-2/#post-6192840)
 * You’re a genius, thank you very much for your quick response.
    I changed my mind
   and chose to use the great plugin DataTables Column Filter. My question is: how
   can set by default that for all my tables show filters at the end of each table
   without adding the shortcode datatables_columnfilter = “true” Can I create some
   function to do this? Is there any way that filters columns, appear at the top
   of the table instead of the end? I hope not to be abusing your kindness Thank
   you very much for everything
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/column-filtering-2/#post-6192842)
 * Hi,
 * sure, you are very welcome!
 * Setting up the Column Filter Extension for all tables only requires a small change
   in the file tablepress-datatables-columnfilter/tablepress-datatables-columnfilter.
   php of the Extension. There, change line 42 to
 *     ```
       $default_atts['datatables_columnfilter'] = 'true';
       ```
   
 * That will turn on the Extension for all tables automatically.
 * I don’t think that the script supports appearing at the top however, as that 
   would interfere with the sorting.
 * Regards,
    Tobias
 *  [jacessario](https://wordpress.org/support/users/jacessario/)
 * (@jacessario)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/column-filtering-2/#post-6192855)
 * That works perfect thanks!
    Is there any way that the filters of each column 
   appears by default the name of the first row? In this way the user will know 
   that they are filter columns.
 *  [jacessario](https://wordpress.org/support/users/jacessario/)
 * (@jacessario)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/column-filtering-2/#post-6192856)
 * I think “Placeholder” is the right term
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/column-filtering-2/#post-6192872)
 * Hi,
 * from what I remember, the cell content of that footer row will be used as that
   placeholder, i.e. just copy the contents of the header row into the footer row.
 * Regards,
    Tobias
 *  [jacessario](https://wordpress.org/support/users/jacessario/)
 * (@jacessario)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/column-filtering-2/#post-6193052)
 * Hello again!
    I wanted to consult you if there is any way to put a link on my
   page so that the client can export your table, thanx and greetings from Argentina!
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/column-filtering-2/#post-6193053)
 * Hi,
 * thanks for your post, and sorry for the trouble.
 * Yes, for this, you could take a look at the TablePress TableTools Extension from
   [https://tablepress.org/extensions/datatables-tabletools/](https://tablepress.org/extensions/datatables-tabletools/)
 * Regards,
    Tobias
 *  [jacessario](https://wordpress.org/support/users/jacessario/)
 * (@jacessario)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/column-filtering-2/#post-6193054)
 * Excellent!!
    Thanks!!!
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/column-filtering-2/#post-6193055)
 * Hi,
 * no problem, you are very welcome! 🙂 Good to hear that this helped!
 * Best wishes,
    Tobias
 * P.S.: In case you haven’t, please [rate TablePress](https://wordpress.org/support/view/plugin-reviews/tablepress)
   here in the plugin directory. Thanks!

Viewing 14 replies - 1 through 14 (of 14 total)

The topic ‘Column filtering’ is closed to new replies.

 * ![](https://ps.w.org/tablepress/assets/icon.svg?rev=3192944)
 * [TablePress - Tables in WordPress made easy](https://wordpress.org/plugins/tablepress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/tablepress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/tablepress/)
 * [Active Topics](https://wordpress.org/support/plugin/tablepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/tablepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/tablepress/reviews/)

 * 14 replies
 * 3 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [10 years, 8 months ago](https://wordpress.org/support/topic/column-filtering-2/#post-6193055)
 * Status: resolved