Title: Hidden sort issue
Last modified: January 28, 2019

---

# Hidden sort issue

 *  Resolved [koikawa](https://wordpress.org/support/users/koikawa/)
 * (@koikawa)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/hidden-sort-issue/)
 * Hi Tobias,
 * I have used a hidden column (column 1) to sort the first column (column 0) by
   date, because column 0 sometimes has a single date, and other times a date range.
 * When you go to the page, it is sorted earliest (Aug 18) to latest (Jan 20). When
   you click the sort arrow for that first column, it sorts instead by date month
   without regard to year (so all January trials, sorted by Month then Day then 
   Year). My desired outcome is that the trials are sorted either earliest to latest,
   or latest to earliest. (So Aug 2018 through Jan 2020, or Jan 2020 through Aug
   2018).
 * My custom commands are:
 * “columnDefs”: [ { “orderData”: [ 1 ], “targets”: [ 0 ] }, { “visible”: false,“
   targets”: [ 1 ] }, { “orderable”: false, “targets”: [ 2, 3, 4, 9,10 ] } ]
 * If this can’t be done, it’s not that big a deal. 🙂 Love this plugin!
 * Kristi
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fhidden-sort-issue%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/hidden-sort-issue/#post-11142946)
 * Hi,
 * thanks for your post, and sorry for the trouble.
 * For this, you will have to use a special date format in the now hidden date column,
   namely `mm/dd/yyyy`. After that, the sorting should work. If now, you could also
   change the command
 *     ```
       { "visible": false, "targets": [ 1 ] }
       ```
   
 * to
 *     ```
       { "visible": false, "type": "date", "targets": [ 1 ] }
       ```
   
 * Regards,
    Tobias
 *  Thread Starter [koikawa](https://wordpress.org/support/users/koikawa/)
 * (@koikawa)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/hidden-sort-issue/#post-11146448)
 * Thanks, Tobias! I changed the hidden column to mm/dd/yyyy and changed the custom
   commands, but it’s still not working.
 * “columnDefs”: [ { “orderData”: [ 1 ], “targets”: [ 0 ] }, { “visible”: false,“
   type”: “date”, “targets”: [ 1 ] }, { “orderable”: false, “targets”: [ 2, 3, 4,
   9,10 ] } ]
 * I’ve made a page where I can mess around with it: [https://usbcha.com/test-page-for-hidden-column-sort/](https://usbcha.com/test-page-for-hidden-column-sort/)
 * Can you tell me what I’m missing?
 * Thanks so much!
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/hidden-sort-issue/#post-11147591)
 * Hi,
 * that doesn’t seem to be the “Custom Command” that is used on that page? There,
   it seems, the “Custom Command” is just
 *     ```
       "columnDefs": [ { "visible": false, "targets": [1] } ]
       ```
   
 * Regards,
    Tobias
 *  Thread Starter [koikawa](https://wordpress.org/support/users/koikawa/)
 * (@koikawa)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/hidden-sort-issue/#post-11149414)
 * I’m so sorry! OK, the custom command is there now.
 * Sorry!
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/hidden-sort-issue/#post-11149806)
 * Hi,
 * you have now copied the “Custom Command” with the “wrong” quotation marks. They
   need to be upright `"` and not curly `”`.
    Could you please take a look at that?
   🙂
 * Regards,
    Tobias
 *  Thread Starter [koikawa](https://wordpress.org/support/users/koikawa/)
 * (@koikawa)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/hidden-sort-issue/#post-11150794)
 * Oh yay, it totally works! Such an amateur mistake, using the wrong quote. So 
   sorry to waste your time!
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/hidden-sort-issue/#post-11152319)
 * 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/plugin/tablepress/reviews/#new-post)
   here in the plugin directory. Thanks!

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

The topic ‘Hidden sort issue’ 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

 * [hidden column](https://wordpress.org/support/topic-tag/hidden-column/)
 * [sort](https://wordpress.org/support/topic-tag/sort/)

 * 7 replies
 * 2 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [7 years, 4 months ago](https://wordpress.org/support/topic/hidden-sort-issue/#post-11152319)
 * Status: resolved