Shopify themes, liquid, logos, and UX
I would like to remove the following sort by options on my website (www.studioyouka.nl) (SENSE theme):
Alphabetical - A-Z
Alphabetical - Z-A
Date - Old to new
Can somebody tell me which code I need to use? 🙂
Solved! Go to the solution
This is an accepted solution.
Hey @Iris27,
Go to your theme's "Edit Code" Option, then in the search bar type "theme.liquid"
Above the tag "</body>" tag paste the following. Screenshot attached for reference.
<script>
document.addEventListener('DOMContentLoaded', function() {
try {
const sortBySelect = document.querySelectorAll('select[name="sort_by"] option');
for (const option of sortBySelect) {
if (option.value === "title-ascending" || option.value === "title-descending" || option.value === "created-ascending") {
option.remove();
}
}
} catch {}
});
</script>
Screenshot for reference
This is an accepted solution.
Hey @Iris27,
Go to your theme's "Edit Code" Option, then in the search bar type "theme.liquid"
Above the tag "</body>" tag paste the following. Screenshot attached for reference.
<script>
document.addEventListener('DOMContentLoaded', function() {
try {
const sortBySelect = document.querySelectorAll('select[name="sort_by"] option');
for (const option of sortBySelect) {
if (option.value === "title-ascending" || option.value === "title-descending" || option.value === "created-ascending") {
option.remove();
}
}
} catch {}
});
</script>
Screenshot for reference
Thank you!!
This solution works for the first time. Once I select the sort options say (price, low to high), disabled options come back. What would efficient event to listen?
Discover how to increase customer engagement on your store with articles from Shopify A...
By Jacqui Apr 23, 2025Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025