In this tutorial we will learn how to remove the sorting dropdown from Woocommerce product listing page i.e. shop page.
Before moving to the solution I assume that you’ve created one or more products in your Woocommerce shop. If you haven’t created any product got to the admin panel and add a product.
Our team at Themelocation is comprised of WordPress developers of high expertise
- We can maintain, support and manage your single, or all your clients, website with dedication
- Our skills are at your disposal.
The task is pretty simple and you don’t need to dig into Woocommerce’s code to achieve that. It can be done easily by using a hook provided by Woocommerce.
Initially the shop page will look like this
So open functions.php file of your theme and Add the following code to the functions file.
// remove default sorting dropdown remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 30 );
Refresh the page and the sorting dropdown must be removed from the shop page.
Don’t forget to clear cache if enabled.