Last Updated:

How to Sort WordPress RSS Feeds by Modified Date

WordPress has an excellent system for generating rss feeds. These feeds can normally be generated by adding a simple word at the end of each address expressing an article, category, tag and even the entire site. If for instance our site is called example.tlc:

  • and I want the rss feed of the latest published articles I will have to go to the address example.tlc/feed
  • and I want the rss feed of the latest articles published in a certain category I'll write example.tlc/category/feed
  • etc...

However, there may be a need to sort the articles' rss feeds by modification date. This could be useful if you need to keep a featured article up-to-date or to let users know that there has been a certain change. So how do you sort wordpress rss feeds by article modification date? The answer is much simpler than you might think. If for example our site is called example.tlc:

  • and I want the rss feed of articles sorted in descending order according to the date of last modification I will have to go to
    example.tlc/feed/?orderby=modified&order=desc
  • and I want the rss feed of articles sorted in descending order by date of last modification I would go to
    example.tlc/category/feed/?orderby=modified&order=desc
  • etc.

As you can easily guess, this involves calling up the post_modified column within the table that is normally called wp_posts if you did not rename it during installation. I hope the article is sufficiently clear and always feel free to ask me anything in the comments. I should usually reply within the day.