WooCommerce: sort products from oldest to most recent

Remi | August 4, 2014 | in Tips

Here is a quick snippet that will be handy for many of you! This snippet allows you to create a new default sorting method to list your products from oldest to most recent. To use it, simply add the following code in the file called functions.php in your theme folder:

Here is the result in the administration:


The author

About the author Remi: Hey! My name is RĂ©mi Corson, i'm a WordPress Expert Developer, i create high level themes and plugins, and i provide free stuff every week on this website!

One comment

  1. georgewiggles

    Hi. Thanks for your tutorials. I have added some custom meta fields for my products using a post you wrote about a year ago, but have not yet figured out how to be able to sort products using these custom fields by adding them to the sort options like you did above.

    I can get new sorting options to appear in the dropdown, but they don’t actually draw any info from the custom fields it seems. Can you give me some direction on how I can make this work?


Leave a reply