Title: DataTables Sorting plugin not working as expected
Last modified: March 28, 2021

---

# DataTables Sorting plugin not working as expected

 *  Resolved [mathse](https://wordpress.org/support/users/mathse/)
 * (@mathse)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/datatables-sorting-plugin-not-working-as-expected/)
 * Hello,
    I have a simple example table created, with a German date in the first
   column. The cvs file, which I import with Tablepress is upoaded here: [https://pastebin.ubuntu.com/p/yKzfZ2rc6n/](https://pastebin.ubuntu.com/p/yKzfZ2rc6n/)
 * I also have installed DataTables Sorting plugin. With just enabling this, sorting
   the “Datum” column does not work, so I added:
 *     ```
       "columnDefs": [ { "type": "formatted-num", "targets": [ 0 ] } ]
       ```
   
 * To the commands of the table – which unfortunately does not help either.
    The
   ordering by date is wrong, here is a simple picture of the result: [https://i.postimg.cc/TP52mw7s/20210328174249.png](https://i.postimg.cc/TP52mw7s/20210328174249.png)
 * This is just a simple example, in reality I want to use it with a much bigger
   table – with the same problems. Sorting doesn’t work.
    Can anybody help me here?
 * Thanks
 * Mathias

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

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/datatables-sorting-plugin-not-working-as-expected/#post-14246218)
 * Hi,
 * thanks for your post, and sorry for the trouble.
 * Please try using
 *     ```
       "columnDefs": [ { "type": "date-eu", "targets": [ 0 ] } ]
       ```
   
 * as the “Custom Command”. You will need the date sorting algorithm here, not the
   one for formatted numbers.
 * Regards,
    Tobias
 *  Thread Starter [mathse](https://wordpress.org/support/users/mathse/)
 * (@mathse)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/datatables-sorting-plugin-not-working-as-expected/#post-14260462)
 * Hello Tobias,
 * thanks for the fast reply and help! That’s indeed it and this fixed the problem
   for me. I didn’t find this in the docs but it (of course) makes sense.
 * Thanks for your help!
 * May I ask one last question: Is sorting done locally or does ist use server ressources?
   I ask because I just have very limited resources on the server and would disable
   it, if it is done there.
 * Greetings
 * Mathias
    -  This reply was modified 5 years, 1 month ago by [mathse](https://wordpress.org/support/users/mathse/).
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/datatables-sorting-plugin-not-working-as-expected/#post-14261365)
 * Hi,
 * no problem, you are very welcome! 🙂 Good to hear that this helped!
 * And no worries, the sorting is done in the browser on the client-side. Your server
   has nothing to do with this 🙂
 * 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 3 replies - 1 through 3 (of 3 total)

The topic ‘DataTables Sorting plugin not working as expected’ 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/)

 * 3 replies
 * 2 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [5 years, 1 month ago](https://wordpress.org/support/topic/datatables-sorting-plugin-not-working-as-expected/#post-14261365)
 * Status: resolved