Skip to content

Instantly share code, notes, and snippets.

@corsonr
Last active September 25, 2022 09:11
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save corsonr/4a40615603682c7629b4323341dad215 to your computer and use it in GitHub Desktop.
Save corsonr/4a40615603682c7629b4323341dad215 to your computer and use it in GitHub Desktop.
WooCommerce: remove products ordering dropdown select in shop page

Remove default ordering on WooCommerce Shop page

This snippet gives the ability to remove the default product sortering dropdown select on the shop page. You can place the code in functions.php.

<?php // Do not include this if already open! Code goes in theme functions.php.
/**
* Remove WooCommerce default catalog ordering from shop page.
*/
add_action( 'after_setup_theme', 'remove_woocommerce_catalog_ordering', 1 );
function remove_woocommerce_catalog_ordering() {
remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 30 ); // If using Storefront, replace 30 by 10.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment