Title: Reverse sort?
Last modified: September 24, 2023

---

# Reverse sort?

 *  Resolved [melsmarsh](https://wordpress.org/support/users/melsmarsh/)
 * (@melsmarsh)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/reverse-sort/)
 * So I am starting to work on my academic personal website. I’m hoping to use Tablepress
   to help list all my articles. However, traditionally, academics need their work
   always listed in *reverse* chronological order. Is there a way to force this 
   to sort in a reverse order (by year) at least originally without having to move
   items every time something is published?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Freverse-sort%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 15 replies - 1 through 15 (of 29 total)

1 [2](https://wordpress.org/support/topic/reverse-sort/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/reverse-sort/page/2/?output_format=md)

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/reverse-sort/#post-17074883)
 * Hi,
 * thanks for your post, and sorry for the trouble.
 * You have multiple options here:
    - Either sort the table by column A on its “Edit” screen (double-click on the
      column header cell) (and repeat this whenever you don’t directly insert new
      rows at the top).
    - Or, initiate an automatic sort when the page is loaded, by adding this to 
      the “Custom Commands” text field in the “Table Features for Site Visitors”
      section on the table’s “Edit” screen:
      `"order": [ [ 0, "desc" ] ]`
    - Or, take a look at the [Row Order feature module](https://tablepress.org/modules/row-order/)
      that is part of the [TablePress premium versions](https://tablepress.org/pricing/).
      This can essentially be used to automatically create that sorted view, but
      does so on the server.
 * Regards,
   Tobias
 *  Thread Starter [melsmarsh](https://wordpress.org/support/users/melsmarsh/)
 * (@melsmarsh)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/reverse-sort/#post-17075008)
 * Thank you, I had tried that first option but it never worked. Second one works
   like a charm though! Thank you!!
 *  Thread Starter [melsmarsh](https://wordpress.org/support/users/melsmarsh/)
 * (@melsmarsh)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/reverse-sort/#post-17075009)
 * I’ll mark as resolved too. Thanks again.
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/reverse-sort/#post-17075298)
 * Hi,
 * no problem, you are very welcome! 🙂 Good to hear that this helped!
 * Best wishes,
   Tobias
 *  Thread Starter [melsmarsh](https://wordpress.org/support/users/melsmarsh/)
 * (@melsmarsh)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/reverse-sort/#post-17136730)
 * Sooooo…. apparently this only started working with some of the tables. My most
   recent are not working. My clinical and teaching are still sorting incorrectly.
 *  Thread Starter [melsmarsh](https://wordpress.org/support/users/melsmarsh/)
 * (@melsmarsh)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/reverse-sort/#post-17141375)
 * So in Opera it’s fine in everything. In Chrome, half are not working now but 
   others are fine. I cleared my cache. I don’t understand.
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/reverse-sort/#post-17146474)
 * Hi,
 * I can’t really check on your site right now, as it seems to have issues with 
   your configured CDN and therefore looks off (with CSS files missing).
 * However, from what I can see, you are referring to column that have text like“
   2021-present” in them, right? These can indeed not directly be sorted, due to
   that text. The sorting algorithm can not know how to treat this. You could therefore
   look into using an approach like [https://wordpress.org/support/topic/date-order-6/](https://wordpress.org/support/topic/date-order-6/)
   where you add a new column that only contains a single year, and which could 
   then be configured to be used for sorting of the column that has years and texts
   mixed.
 * Regards,
   Tobias
 *  Thread Starter [melsmarsh](https://wordpress.org/support/users/melsmarsh/)
 * (@melsmarsh)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/reverse-sort/#post-17147051)
 * Sorry about that. Astra’s tech support had to log into my site yesterday to help
   with a mobile issue (menu no longer appears on mobile) and I don’t know what 
   they did, but they screwed it up. I had to get a backup from a few days ago. 
   It should be ok now.
   But yes, you are correct. The hidden column trick seemed
   to work well enough at least in Opera… Thank you for that. I kept scrolling through
   all the posts a few times just to look for where to hide things and originally
   missed it in the plugin itself, haha. It’s too early in the morning to be working
   on websites. Sigh.
 * A less annoying problem is there any easy way to not have certain columns information
   break in a certain way? IE, my clinical work. My work titles are long, I understand
   if that needs to break, but having my years break or the city/state break is 
   strange.
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/reverse-sort/#post-17147505)
 * Hi,
 * ah, I see. Sorry to hear that you are having trouble with your webhost.
 * The idea with the hidden column should work in all browsers, actually 🙂
 * To turn off line breaks in the “Year” and “Location” columns, you can add this
   to the “Custom CSS” text area on the “Plugin Options” screen of TablePress:
 *     ```wp-block-code
       .tablepress-id-7 .column-1,
       .tablepress-id-7 .column-7 {
         white-space: nowrap;
       }
       ```
   
 * Best wishes,
   Tobias
 *  Thread Starter [melsmarsh](https://wordpress.org/support/users/melsmarsh/)
 * (@melsmarsh)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/reverse-sort/#post-17147705)
 * It’s less the host, more the theme. As my husband (who works in IT mind you) 
   he doesn’t understand why computers don’t behave consistently when I am in the
   room.
 * OK… so I just checked and it looks like it still isn’t fully working either on
   the clinical or the teaching page sorting wise. I have anything that is really
   listed as present listed as 50000 (or higher!) in the column which is higher (
   obviously than 2023). It was trying to trick me.
 * The clinical page isn’t breaking anymore though it still has the sort order.
 * The teaching page still isn’t sorting though it also has a hidden column which
   it is supposed to sort by AND it is still breaking column 1.
 * I checked it on Chrome, Opera, and iphone.
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/reverse-sort/#post-17147804)
 * Hi,
 * from what I can see, there’s no new/hidden column that can be used for sorting
   the first column, at least on [https://melsmarsh.com/healthcare/](https://melsmarsh.com/healthcare/)
 * That’s what you will have to add first, and then use that approach from my link.
 * To turn off the word-wrapping/line-breaks on the Teaching table as well, you’ll
   need to copy the CSS code from above and insert it again with the adjusted table
   ID for that table.
 * Regards,
   Tobias
 *  Thread Starter [melsmarsh](https://wordpress.org/support/users/melsmarsh/)
 * (@melsmarsh)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/reverse-sort/page/2/#post-17147813)
 * See that’s the thing… I am looking directly at it.
 * Here is a screenshot for the clinical page when in Tablepress. Likewise the courses
   and performance page are all set up similarly.
 * ![](https://i0.wp.com/melsmarsh.com/wp-content/uploads/2023/10/Screenshot-18.
   png?ssl=1)
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/reverse-sort/page/2/#post-17147875)
 * Hi,
 * ah, I see. Hiding the column on the “Edit” screen will not work. Instead, please
   unhide it there again, and then use the “Custom Command” that is explained in
   my link above. That will hide the column from the visitor (but it must be part
   of the frontend table, which is why hiding it on the “Edit” screen will not work),
   and also configure it for use when sorting for the (then)-second column of the
   table.
 * Regards,
   Tobias
 *  Thread Starter [melsmarsh](https://wordpress.org/support/users/melsmarsh/)
 * (@melsmarsh)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/reverse-sort/page/2/#post-17147958)
 * What is the code? I tried
 * 
   .tablepress-id-7 .column-0 { display: none; }
 * and it’s not hiding column 0 and the table went back to breaking.
 *  Thread Starter [melsmarsh](https://wordpress.org/support/users/melsmarsh/)
 * (@melsmarsh)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/reverse-sort/page/2/#post-17147969)
 * Also as you might notice, they are not reverse sorting and are not going away.
 * I think the tables are 5, 6, 7

Viewing 15 replies - 1 through 15 (of 29 total)

1 [2](https://wordpress.org/support/topic/reverse-sort/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/reverse-sort/page/2/?output_format=md)

The topic ‘Reverse sort?’ 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/)

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