All things Shopify and commerce
Is anyone else struggling with the updated Default Sort Order that changed from Alphabetical to Newest Created on Feb 5/2025? Shopify support is telling me there is no way to change my default sort order back to Alphabetical - the best recommendation they offered was to hire a third party to change the code in the back end to customize my Shopify site. I'm frustrated with the recommendation that I need to spend more money to have my shop set up the way that works for me.
Hi @TKEQShop ,
You may need to make a small change in the code to get this done:
Go to the Theme Editor:
Locate the Collection Template:
Find the Sort Order Code:
You can also use apps such as Collection Sort by Power Tools or Smart Collection Filters & Search to have more control on your filtering.
Hey @TKEQShop,
You can modify your Shopify theme to automatically sort products alphabetically by adding a small code snippet to your theme files. This ensures a consistent alphabetical sorting experience without requiring ongoing maintenance or third-party apps.
The solution involves adding either a JavaScript snippet to your theme.liquid file or a Liquid-based solution to your collection-template.liquid file. This modification automatically redirects visitors to an alphabetically sorted view when they land on your collection pages.
I’m sharing this because such basic functionality shouldn’t require hiring a developer or paying for an app. While Shopify’s decision to change the default sorting behavior makes sense in some cases, restoring alphabetical sorting should be simple and accessible.
<script> document.addEventListener('DOMContentLoaded', function() { // Check if the current page is a collection page if (window.location.pathname.includes('/collections/')) { // Get the current sorting parameter const urlParams = new URLSearchParams(window.location.search); const currentSort = urlParams.get('sort_by'); // Redirect to alphabetical sorting if no sort parameter is set if (!currentSort) { window.location.href = window.location.pathname + '?sort_by=title-ascending'; } } }); </script>
{% if collection.sort_by == blank %} <script> window.location.href = '{{ collection.url }}?sort_by=title-ascending'; </script> {% endif %}
This quick fix restores alphabetical sorting without the need for third-party solutions or ongoing maintenance.
Cheers!
Shubham | Untechnickle
Helping for free: hello@untechnickle.com
Don't forget to say thanks, it'll make my day - just send me an email!
Get Revize for Free | Let your shoppers edit orders post-purchase | Get Zero Support Tickets | #1 Order Editing + Upsell App
Thank you so much for this - to confirm this is to do with my products page on my Shopify Account - I don't have any problems with how things are appearing to my customers. This is more an internal problem. I will give this a try if so 🙂
Hi Natalie,
Thank you for your follow-up email! I hope you're doing fantastic.
Please ignore my previous solution - ;et me offer you a simple, free solution that affects only your backend admin panel - not your customer-facing store. This method uses a browser extension called Tampermonkey to automatically sort your products alphabetically in the admin panel.
1. Install the Tampermonkey Extension:
For Chrome:
Visit the Chrome Web Store and search for "Tampermonkey".
For Firefox:
Visit Firefox Add-ons and search for "Tampermonkey".
2. Add the Sorting Script:
// ==UserScript== // @name Shopify Admin Automatic Alphabetical Sort // @namespace http://tampermonkey.net/ // @version 1.3 // @description Automatically sort Shopify admin product list alphabetically // @author You // @match https://admin.shopify.com/store/*/products* // @grant none // ==/UserScript== (function() { 'use strict'; function sortProductsAlphabetically() { const tableBody = document.querySelector('.Polaris-IndexTable__Table tbody'); if (!tableBody) { console.log('Table body not found, waiting...'); return false; } const rows = Array.from(tableBody.querySelectorAll('tr[id^="gid://shopify/Product/"]')); if (rows.length <= 1) { console.log('Not enough rows to sort'); return false; } rows.sort((a, b) => { const titleA = a.querySelector('a[data-primary-link="true"] span')?.textContent.trim().toLowerCase() || ''; const titleB = b.querySelector('a[data-primary-link="true"] span')?.textContent.trim().toLowerCase() || ''; return titleA.localeCompare(titleB); }); rows.forEach(row => tableBody.appendChild(row)); return true; } function observeProductList() { const productTable = document.querySelector('.Polaris-IndexTable'); if (!productTable) { setTimeout(observeProductList, 1000); return; } const observer = new MutationObserver((mutations) => { setTimeout(() => { sortProductsAlphabetically(); }, 500); }); observer.observe(productTable, { childList: true, subtree: true }); sortProductsAlphabetically(); } function attemptInitialSort(attempts = 0) { if (attempts > 10) return; if (!sortProductsAlphabetically()) { setTimeout(() => attemptInitialSort(attempts + 1), 1000); } else { observeProductList(); } } if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', () => attemptInitialSort()); } else { attemptInitialSort(); } window.addEventListener('popstate', () => attemptInitialSort()); window.addEventListener('pushstate', () => attemptInitialSort()); window.addEventListener('replacestate', () => attemptInitialSort()); })();
3. Save the Script:
Summary:
If you ever want to disable the alphabetical sorting, simply:
Please let me know if you need any help with the installation or have any questions, I’m happy to clarify any steps or assist with troubleshooting.
Best regards,
Shubham | Untechnickle
P.S. Remember to refresh your Shopify admin page after installing the script for the changes to take effect.
Helping for free: hello@untechnickle.com
Don't forget to say thanks, it'll make my day - just send me an email!
Get Revize for Free | Let your shoppers edit orders post-purchase | Get Zero Support Tickets | #1 Order Editing + Upsell App
I second this I am getting so frustrated for the new automatic sort order in the admin for products and also for purchase orders. Shopify there needs to be a way for us to set our preferences for the default sort order the new ones are wasting our time having to resort every time we use these pages.
Yes! This is so frustrating. I don't understand why this change was made to begin with, when alphabetical order should always be the default.
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025