Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save khikrama/92dcebdef416b2d3721a to your computer and use it in GitHub Desktop.
Save khikrama/92dcebdef416b2d3721a to your computer and use it in GitHub Desktop.
<?php
// Modify the default WooCommerce orderby dropdown
//
// Options: menu_order, popularity, rating, date, price, price-desc
// In this example I'm removing price & price-desc but you can remove any of the options
function my_woocommerce_catalog_orderby( $orderby ) {
unset($orderby["price"]);
unset($orderby["price-desc"]);
return $orderby;
}
add_filter( "woocommerce_catalog_orderby", "my_woocommerce_catalog_orderby", 20 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment