Customize WooCommerce Related Products Order

WooCommerce Related Products Order

By default the section of the WooCommerce related products sorted by random. Sometimes this is not expected like recently a client wanted to sort the default WooCommerce related products order by date. This is very simple to achieve if you have some experiences to edit the WooCommerce template files. But if you don’t have any experience, don’t worry, just keep reading.

Move Related Products Template

First of all you need to copy the WooCommerce related products template file related.php from the WooCommerce plugin folder woocommerce/templates/single-product/related.php to your theme folder yourtheme/woocommerce/single-product/related.php


Or you can simply create a folder called woocommerce inside your theme folder then create another folder called single-product. Finally inside that single-product create a related.php file.

WooCommerce Related Products Order Code

Now copy all the below codes and paste them in your theme’s related.php file.



You are done! You have sorted the WooCommerce related products order by date successfully.

Need Help with WooCommerce?

I’m a passionate WooCommerce developer and provide custom WooCommerce solutions. I offer high quality WooCommerce customization services with a very fast turnaround time. If you need my help, just click on the below button and I will be in touch within 24 hours.


Get help customizing WooCommerce