Change Default Sorting on Main Product Catalogue

Topic summary

Goal: Change the main product catalogue’s default sort from A–Z to newest first (‘created-descending’).

What was tried:

  • Edited main-collection-product-grid.liquid and targeted the assign line: {%- assign sort_by = collection.sort_by | default: collection.default_sort_by -%}.
  • Added a conditional override for the All Products collection: if collection.handle == ‘all’ then assign sort_by = ‘created-descending’.
  • Despite these changes, the default did not switch to newest-first.

Open question:

  • What exact value should replace or override collection.default_sort_by to sort by product upload date?

References and guidance shared:

  • A reply pointed back to the same assign line but didn’t provide the specific value.
  • Another reply linked to Shopify’s documentation for collection.default_sort_by to identify valid options, including ‘created-descending’.

Status: No confirmed solution in the thread. The next step implied is to use the Shopify docs to set or override default_sort_by (e.g., to ‘created-descending’) for the relevant collection, especially the ‘all’ collection.

Summarized with AI on January 15. AI used: gpt-5.

Currently, the way the default product catalogue is sorted is by A-Z.
I want to change the default sorting to the newest products first. AKA “‘created-descending’”

I’ve tried editing a bit of code on the “main-collection-product-grid.liquid”, specifically:

// tried changing the default in this code to a few different options.

{%- assign sort_by = collection.sort_by | default: collection.default_sort_by -%}

// Added the below code as well.
{% if collection.handle == “all” %}
{% assign sort_by = ‘created-descending’ %}
{% endif %}

Please advise how to change the default sorting of the main product catalogue

  1. In the theme editor, navigate to the “Sections” folder and open the main-collection-product-grid.liquid file.

  2. Look for the following code:

{%- assign sort_by = collection.sort_by | default: collection.default_sort_by -%}

Thanks for the reply Nomtech!

I have already messed with that code to no avail.

I’m sure it’s the right line of code to change but I dont know what to change it to, in order to default it by product upload date.

I probably change this part, yea? “default: collection.default_sort_by”

To what?

https://shopify.dev/docs/api/liquid/objects/collection#collection-default_sort_by