Title: Sorting URL columns &#8211; Problem and Solution
Last modified: December 14, 2017

---

# Sorting URL columns – Problem and Solution

 *  Resolved [Åke Strandberg](https://wordpress.org/support/users/akestrandberg/)
 * (@akestrandberg)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/sorting-url-columns-problem-and-solution/)
 * URL columns have problems with sorting. If data is a simple url it is sorted 
   alphabetically wich is correct. If data is formatted as url||DisplayText it is
   sorted by the whole string and not by DisplayText only. In most cases the column
   will be sorted on url. This makes sorting on this column type confusing for the
   end user.
 * I have been diving into the code and found a solution that solves my problem 
   but I admit that I have not tested it with html code in DisplayText.
 * In the file plugins\wpdatatables\source\class.link.wpdatacolumn.php
 * change
    `protected $_jsDataType = 'string';` to `protected $_jsDataType = 'html';`
 * Please consider to make this change in the code either permanently or as a configurable
   option.

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

 *  Plugin Author [wpDataTables](https://wordpress.org/support/users/wpdatatables/)
 * (@wpdatatables)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/sorting-url-columns-problem-and-solution/#post-9804037)
 * Hi there,
 * Thank you for sending this over. We will see how to implement and solve this 
   the best way, maybe will go with your suggestion!
 *  [Patrick](https://wordpress.org/support/users/zunichi/)
 * (@zunichi)
 * [7 years, 12 months ago](https://wordpress.org/support/topic/sorting-url-columns-problem-and-solution/#post-10402046)
 * Any word on this? I have been experiencing the same issue and have found no other
   workaround than the solution posted by [@akestrandberg](https://wordpress.org/support/users/akestrandberg/).
   Any help would be appreciated. Thanks!
    -  This reply was modified 7 years, 12 months ago by [Patrick](https://wordpress.org/support/users/zunichi/).

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

The topic ‘Sorting URL columns – Problem and Solution’ is closed to new replies.

 * ![](https://ps.w.org/wpdatatables/assets/icon-128x128.gif?rev=3010404)
 * [wpDataTables - WordPress Data Table, Dynamic Tables & Table Charts Plugin](https://wordpress.org/plugins/wpdatatables/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wpdatatables/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wpdatatables/)
 * [Active Topics](https://wordpress.org/support/plugin/wpdatatables/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpdatatables/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpdatatables/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [Patrick](https://wordpress.org/support/users/zunichi/)
 * Last activity: [7 years, 12 months ago](https://wordpress.org/support/topic/sorting-url-columns-problem-and-solution/#post-10402046)
 * Status: resolved