Skip to content

Early-bird lifetime licence: $199 once, for the first 200 buyers only. See the offer

Remove the “Default sorting” dropdown

Removes the sort dropdown from the shop and category pages.

  • Type PHP
  • Runs Everywhere (runs as WordPress loads)
  • Needs WooCommerce
  • Category WooCommerce
  • Tested with WordPress 7.1, WooCommerce 11.1
PHP
<?php

add_action(
	'wp',
	static function () {
		// Above and below the products, at whatever priority the theme uses (Storefront moves it).
		foreach ( array( 'woocommerce_before_shop_loop', 'woocommerce_after_shop_loop' ) as $hook ) {
			$priority = has_action( $hook, 'woocommerce_catalog_ordering' );
			if ( false !== $priority ) {
				remove_action( $hook, 'woocommerce_catalog_ordering', $priority );
			}
		}
	}
);

In these packs

Move your snippets over this afternoon.

Importing changes nothing until you switch over, and your old shortcodes keep working.