# How can I sort the topic replies by date

**URL:** <https://meta.discourse.org/t/how-can-i-sort-the-topic-replies-by-date/238344>\
**Category:** Migration\
**Tags:** rest-api\
**Created:** [September 7, 2022, 2:18pm UTC](https://meta.discourse.org/t/how-can-i-sort-the-topic-replies-by-date/238344 "2022-09-07T14:18:00Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![CarlosDaniel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/carlosdaniel/32/273223_2.png) [@CarlosDaniel](https://meta.discourse.org/u/CarlosDaniel)\
**Post date:** [September 7, 2022, 2:18pm UTC](https://meta.discourse.org/t/how-can-i-sort-the-topic-replies-by-date/238344/1 "2022-09-07T14:18:00Z")

</div>

Hello. I don’t know if it’s possible, and if it is I googled a lot and did not find anything about this, but I would like to sort all the replies of all the topics of my forum by the created date.

I’ve been working on a migration of data from an old forum to a brand new Discourse one. To do that, I am recreating the topics and replies via API so that I can send them to Discourse on the date the reply was created initially. That has been working just fine as when I go to the created replies on Discourse I can see that the original date is over there.

 ![image](https://global.discourse-cdn.com/meta/original/4X/f/6/3/f636e8b7869b16e8a9edac1c213929438febc062.jpeg)

But even though all the replies are with the original date, they are sorted by the order they were created on the API. I don’t know if this is a bug or meant to be or if there is any way to sort them by the date I set on the API POST call, but if so I’d like some help on this topic. Cheers guys.

I am using version 2.8.8.

---

_[View the full topic](https://meta.discourse.org/t/how-can-i-sort-the-topic-replies-by-date/238344)._
