Title: Hide column with custom command.
Last modified: August 30, 2016

---

# Hide column with custom command.

 *  Resolved [rwboyer](https://wordpress.org/support/users/rwboyer/)
 * (@rwboyer)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/hide-column-with-custom-command/)
 * Looking thru the forum I found a few answers to what I was trying to do. Here’s
   the rub: The answers are over a year old and using the EXACT same method I’m 
   getting an error in the JS for datatables now..
 * Like others I need to hide a column but still have it searchable. I have this
   in the custom commands field for the table:
 * “columnDefs”: [ { “visible”: false, “targets”: [ 3 ] } ]
 * intending to hide column 3 (4th column starting count at 0).
 * This now breaks the JS for tablepress. I get the following error in the browser:
 * TypeError: undefined is not an object (evaluating ‘i._DT_CellIndex={row:b,column:
   l}’)
    Jajquery.datatables.min.js:23:174 Njquery.datatables.min.js:15:231 (anonymous
   function)jquery.datatables.min.js:15:343 (anonymous function)jquery.js:1:927 
   mapjquery.js:1:3717 mapjquery.js:1:894 majquery.datatables.min.js:15:310
 * Just the first few lines in the call stack.
 * Any hep would be fantastic.
 * RB
 * [https://wordpress.org/plugins/tablepress/](https://wordpress.org/plugins/tablepress/)

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

 *  Thread Starter [rwboyer](https://wordpress.org/support/users/rwboyer/)
 * (@rwboyer)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/hide-column-with-custom-command/#post-6864967)
 * also tried a different version that was posted here that was even older same 
   results:
 * “aoColumnDefs”: [ { “bVisible”: false, “aTargets”: [ 6 ] } ]
 *  Thread Starter [rwboyer](https://wordpress.org/support/users/rwboyer/)
 * (@rwboyer)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/hide-column-with-custom-command/#post-6864974)
 * Figured out the issue:
 * Hidden columns via the plugin editor are not counted/visible at all to the JS
   so my numbering was wonky.
 * Sorry/Thanks
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/hide-column-with-custom-command/#post-6865226)
 * Hi,
 * thanks for your post, and sorry for the trouble.
    Also, sorry for the long wait
   for a reply. As a I was on a long vacation without internet access the last couple
   weeks, I could not reply earlier.
 * Yes, the counting only applies to the actual columns that are sent to the browser.
   Good to hear that you already found this! 🙂
 * Best wishes,
    Tobias

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

The topic ‘Hide column with custom command.’ 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/)

## Tags

 * [custom commands](https://wordpress.org/support/topic-tag/custom-commands/)

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