You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在WooCommerce安装实例中完全移除Sort by下拉菜单

How to Remove the "Sort by" Dropdown from WooCommerce Product Category Pages

There are a few reliable ways to completely remove the Sort by dropdown from your WooCommerce category pages. Here are the most common methods:

This method removes the dropdown at the code level, which is the cleanest approach. Add the following code to your child theme's functions.php file, or use a custom code snippets plugin to avoid editing theme files directly:

add_filter( 'woocommerce_catalog_orderby', '__return_empty_array' );

This filter overrides WooCommerce's default orderby options and returns an empty array, so the platform won't render the dropdown at all.

Method 2: Hide with CSS

If you prefer a quick visual fix (note: this doesn't remove the element from the DOM, just hides it from view), add this CSS to your theme's custom CSS section or child theme's style.css:

.woocommerce-ordering {
    display: none !important;
}

To target only specific category pages (like your signed photos category), use the category's unique body class:

.tax-product-category.term-signed-photos .woocommerce-ordering {
    display: none !important;
}

Method 3: Use a Customization Plugin

If you don't want to edit code directly, you can use a plugin like Code Snippets to add the filter hook from Method 1, or a WooCommerce-specific customization plugin that lets you disable the sorting dropdown via a simple settings panel.

Always remember to back up your site before making code changes, and use a child theme to avoid losing modifications when your parent theme updates.

内容的提问来源于stack exchange,提问作者pgilpat

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.26 10:01:48