/* Change Order of Default Sorting WooCommerce */
function wpflt_change_order_default_sorting_options( $options ) {
$options = array(
'popularity' => 'Sort by popularity',
'price' => 'Sort by price: low to high',
'price-desc' => 'Sort by price: high to low',
'rating' => 'Sort by average rating',
'date' => 'Sort by latest',
'menu_order' => 'Default sorting',
); return $options; }
add_filter( 'woocommerce_catalog_orderby', 'wpflt_change_order_default_sorting_options', 5 );
Important: You can also rename the product sorting options in the above code itself. To avoid conflict, DO NOT use both the ‘Rename’ and ‘Sorting Order’ codes together. Use either of them.
Before implementing in your site, test the code in staging environment.