WooCommerce: sort products from oldest to most recent

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:

woocommerce-oldest-to-most-recent

One response to “WooCommerce: sort products from oldest to most recent”

  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?

    Thanks.

Leave a Reply