HOME
blog

Disable Sort By Best Selling In Shopify - Stop Competitors From Stealing

No items found.

Summary

Disable "?sort_by=best-selling" is a great way to stop competitors from stealing your products from your Shopify store.

This is easy to do with a little bit a liquid code. Modify your collection.liquid file to this:

{% if collection.sort_by == 'best-selling' %}
 Nope.
{% else %}
<!-- your original collection.liquid code in here -->
{% endif %}

Or if you prefer using JavaScript, you can insert this code in the <head> section of the theme.liquid file of a theme:

<script>
if(document.location.href.indexOf('https://YOUR-STORE-NAME.com/collections/all?sort_by=best-selling') > -1) {
document.location.href = 'https://YOUR-STORE-NAME.com/collections/all';
}
</script>

Remember to change the store URL to your stores URL. You can feel free to modify the redirection URL to any URL in your store.

Start your affiliate program today

Grow your Shopify store without an upfront cost.

Install For Free