Taming the Order: How to Turn Off Customer Sorting Options in WooCommerce
So, you’ve built your dream online store with WooCommerce. Congratulations! But now, you’re noticing something… your customers are sorting products in ways that don’t quite align with your sales strategy. Perhaps they’re sorting by “popularity” when you’re trying to push new arrivals, or “price (high to low)” is distracting from your valuable mid-range options. Don’t panic! You can absolutely control how your customers sort products in WooCommerce. This article will guide you through turning off those unwanted sorting options, step-by-step, even if you’re a complete newbie.
Think of it like this: you’re a restaurant owner. You wouldn’t let diners decide what order the menu items appear in, would you? You strategically arrange appetizers, entrees, and desserts to guide their choices. Similarly, controlling sorting options in WooCommerce lets you curate the customer experience and influence purchasing decisions.
Why Turn Off Sorting Options?
Before we dive in, let’s quickly cover *why* you might want to disable certain sorting methods:
- Promote Specific Products: Want to feature new arrivals or items on sale? Disabling “popularity” or “price” sorting can help.
- Improve User Experience: Sometimes, too many options create choice paralysis. Simplifying the sorting choices can make it easier for customers to find what they need.
- Optimize Conversions: If a specific sorting option is consistently leading to lower sales, it’s worth considering its removal. Maybe high-price items are scaring people away prematurely!
- Maintain Brand Image: Perhaps sorting by price doesn’t align with your brand’s focus on quality and craftsmanship.
Method 1: Using a Code Snippet (The PHP Way)
This is the most common and often the most reliable method. It involves adding a small piece of PHP code to your website. Don’t worry, it’s not as scary as it sounds!
Important: Before making any changes to your WordPress site, always create a backup. This ensures you can restore your site if something goes wrong.
Here’s the code you’ll need:
<?php /**
// Disable ‘Sort by popularity’ option
unset( $options[‘popularity’] );
// Disable ‘Sort by average rating’ option
//unset( $options[‘rating’] );
// Disable ‘Sort by most recent’ option
unset( $options[‘date’] );
// Disable ‘Sort by price (asc)’ option
unset( $options[‘price’] );
// Disable ‘Sort by price (desc)’ option
unset( $options[‘price-desc’] );
return $options;
}
add_filter( ‘woocommerce_catalog_orderby’, ‘wc_remove_product_sorting_options’ );
?>
How to Use This Code:
1. Access Your `functions.php` File: There are a couple of ways to do this:
- Via WordPress Theme Editor: Go to Appearance > Theme Editor. Look for `functions.php` (usually under “Theme Functions”). Be extremely careful here! One wrong edit can break your site.
- Via FTP (File Transfer Protocol): Use an FTP client like FileZilla to connect to your website’s server. Navigate to `/wp-content/themes/your-theme-name/` and find `functions.php`.
2. Add the Code: Copy and paste the code snippet at the *very end* of your `functions.php` file.
3. Choose Which Options to Disable: Notice the lines that start with `unset( $options[‘…’ ] );`. Each one controls a specific sorting option. The `//` at the beginning of some lines means they are “commented out” – the code won’t run. To disable a sorting option, remove the `//` from the beginning of the line.
- For example, to disable “Sort by popularity”, remove the `//` from the line `//unset( $options[‘popularity’] );` so it looks like this: `unset( $options[‘popularity’] );`
4. Save the File: Click “Update File” in the Theme Editor, or save the file using your FTP client.
5. Clear Your Website Cache: If you’re using a caching plugin (like WP Rocket or W3 Total Cache), clear the cache so the changes take effect.
Explanation of the Sorting Options:
- `’menu_order’` : Default sorting (usually set in the product edit screen)
- `’popularity’` : Sort by sales count.
- `’rating’` : Sort by average product rating.
- `’date’` : Sort by the date the product was published.
- `’price’` : Sort by price (ascending – low to high).
- `’price-desc’` : Sort by price (descending – high to low).
Real-World Example: Let’s say you’re launching a new line of handcrafted jewelry and want to showcase it prominently. You might disable sorting by “popularity” and “price (high to low)” to give your new collection a better chance of being seen.
Why this method is good: It gives you very granular control. You can choose exactly which options to remove.
Method 2: Using a Plugin (The Easy Way)
If you’re uncomfortable editing code directly, a plugin is a great alternative. There are several plugins that can help you manage WooCommerce sorting options. Search the WordPress plugin repository for terms like “WooCommerce sorting control” or “WooCommerce product sorting”.
Example Plugin: While I can’t specifically recommend one without testing it myself (plugins change frequently), look for plugins with good ratings, recent updates, and clear descriptions of their features.
How to Use a Plugin (Generally):
1. Install and Activate the Plugin: Go to Plugins > Add New in your WordPress dashboard. Search for the plugin, install it, and then activate it.
2. Find the Plugin Settings: Most plugins will add a new settings page under the WooCommerce or Settings menu.
3. Configure the Sorting Options: The plugin’s settings page will typically provide checkboxes or other controls to enable or disable the various sorting options.
4. Save Your Changes: Make sure to save the plugin settings.
5. Clear Your Website Cache: As with the code method, clear your cache after making changes.
Why this method is good: It’s often easier for non-developers. The plugin provides a visual interface to manage the sorting options.
Method 3: Theme Customization (Potentially More Complex)
Some WordPress themes include options to customize WooCommerce sorting directly within the theme’s settings. This is less common but worth checking.
How to Check:
1. Go to Appearance > Customize: This opens the WordPress theme customizer.
2. Look for WooCommerce Settings: See if there’s a section specifically for WooCommerce, or look for options related to “product catalog” or “shop page.”
3. Check for Sorting Controls: If you find a WooCommerce section, see if there are settings related to product sorting.
Why this method is less common: It depends entirely on your theme developer and what features they’ve included. It’s also often less flexible than the code or plugin methods.
Troubleshooting
- Changes Not Showing Up? The most common culprit is caching. Clear your website cache *and* your browser cache.
- Syntax Errors: If you’re using the code method and your website breaks after adding the code, you likely have a syntax error (a mistake in the code). Double-check the code carefully. If you’re unsure, revert to your backup or remove the code.
- Plugin Conflicts: If you’re using a plugin and it’s not working correctly, try temporarily disabling other plugins to see if there’s a conflict.
Conclusion
Turning off unwanted customer sorting options in WooCommerce is a simple but powerful way to optimize your online store and guide your customers towards the products you want them to see. Whether you choose the code snippet method for maximum control, a plugin for ease of use, or your theme’s built-in options (if available), remember to always back up your website before making changes. Happy selling!