Title: [Plugin: WP-Table Reloaded] DataTables: hidden columns
Last modified: August 20, 2016

---

# [Plugin: WP-Table Reloaded] DataTables: hidden columns

 *  Resolved [cliffshek](https://wordpress.org/support/users/cliffshek/)
 * (@cliffshek)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-wp-table-reloaded-datatables-hidden-columns/)
 * I know that the plugin itself has options to hide table columns, but I think (?)
   that this means the data is not searchable.
 * So I’ve manually loaded Datatables to my page ([http://www.dexteritymi.com/js2](http://www.dexteritymi.com/js2))
   and am attempting to adapt the code from here: [http://www.datatables.net/release-datatables/examples/basic_init/hidden_columns.html](http://www.datatables.net/release-datatables/examples/basic_init/hidden_columns.html)
 * But so far no success. Many thanks in advance!
 * [http://wordpress.org/extend/plugins/wp-table-reloaded/](http://wordpress.org/extend/plugins/wp-table-reloaded/)

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

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-wp-table-reloaded-datatables-hidden-columns/#post-3032900)
 * Hi,
 * thanks for your question.
 * You are correct. When columns are hidden via the “Edit” screen checkboxes in 
   WP-Table Reloaded, they can not be searched on the frontend.
    This is however
   possible with some extra commands for the DataTables library, just as on that
   page that you found. Good thing: There’s no need to load DataTables to your page
   manually for this! You can just use the “Custom Commands” textfield in the “DataTables
   JavaScript features” section below the table input fields on the “Edit” screen
   of your table. There, you’ll want to enter something like
 *     ```
       "aoColumnDefs": [ { "bVisible": false, "aTargets": [ 0, 3 ] } ]
       ```
   
 * This would for example hide columns 1 and 4 (counting starts at 0), but they 
   should still be searchable.
 * Regards,
    Tobias
 *  Thread Starter [cliffshek](https://wordpress.org/support/users/cliffshek/)
 * (@cliffshek)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-wp-table-reloaded-datatables-hidden-columns/#post-3033006)
 * thanks Tobias.
    indeed the custom command does work, but i need to load DataTables
   manually because i’d like to retain the dropdown column filter at the footer 
   of the table. is there a way to use both functions at the same time?
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-wp-table-reloaded-datatables-hidden-columns/#post-3033010)
 * Hi,
 * ah, ok, I see. In that case, you will need to add this “Custom Command” directly
   to the lines
 *     ```
       var oTable = $('#wp-table-reloaded-id-16-no-1').dataTable({
             "oLanguage": {
               "sSearch": "Search all columns:"
             }
           });
       ```
   
 * in your manual code, like
 *     ```
       var oTable = $('#wp-table-reloaded-id-16-no-1').dataTable({
             "aoColumnDefs": [ { "bVisible": false, "aTargets": [ 0, 3 ] } ],
             "oLanguage": {
               "sSearch": "Search all columns:"
             }
           });
       ```
   
 * Regards,
    Tobias
 *  Thread Starter [cliffshek](https://wordpress.org/support/users/cliffshek/)
 * (@cliffshek)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-wp-table-reloaded-datatables-hidden-columns/#post-3033015)
 * works a charm! thanks Tobias (once again!)
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-wp-table-reloaded-datatables-hidden-columns/#post-3033016)
 * Hi,
 * great 🙂 Thanks for the confirmation!
    And you are very welcome!
 * Best wishes,
    Tobias
 *  Thread Starter [cliffshek](https://wordpress.org/support/users/cliffshek/)
 * (@cliffshek)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-wp-table-reloaded-datatables-hidden-columns/#post-3033072)
 * Ah…
    Yes I can hide columns I want and still search them, but then the footer
   column filters are incorrect. For example, if I hide columns 0 and 1, they are
   hidden and columns 2 and 3 appear first. But the column footer filters shows 
   dropdown info for 0 and 1, and not the info for 2 and 3.
 * Hope that makes sense!
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-wp-table-reloaded-datatables-hidden-columns/#post-3033073)
 * Hi,
 * yeah, that makes sense, I think I understand what is happening here.
 * Unfortunately, I have no idea how to change or fix this, and I think I’m the 
   wrong person to ask. This is better suited for the real DataTables experts, which
   you can find in the forums at [http://www.datatables.net](http://www.datatables.net)
   
   Remember, I’m not the developer of DataTables, I just added it to WP-Table Reloaded
   🙂
 * Best wishes,
    Tobias
 *  Thread Starter [cliffshek](https://wordpress.org/support/users/cliffshek/)
 * (@cliffshek)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-wp-table-reloaded-datatables-hidden-columns/#post-3033078)
 * Thanks Tobias – that makes sense!
    Do you have an email address I can write to?
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-wp-table-reloaded-datatables-hidden-columns/#post-3033086)
 * Hi,
 * you can find my email address in the main plugin file of WP-Table Reloaded, wp-
   table-reloaded.php (if you meant my email address).
    For DataTables, I don’t 
   know an address, you should write in the forums there probably.
 * Regards,
    Tobias

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

The topic ‘[Plugin: WP-Table Reloaded] DataTables: hidden columns’ is closed to 
new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-table-reloaded_f7dcd3.svg)
 * [WP-Table Reloaded](https://wordpress.org/plugins/wp-table-reloaded/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-table-reloaded/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-table-reloaded/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-table-reloaded/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-table-reloaded/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-table-reloaded/reviews/)

 * 9 replies
 * 2 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-wp-table-reloaded-datatables-hidden-columns/#post-3033086)
 * Status: resolved