---
title: "Magento 2: How to Change Default Sort Order from Ascending to Descending for Product Listing in Category Page?"
url: "https://magecomp.com/blog/magento-2-change-default-sort-order-from-ascending-to-descending-for-product-listing-in-category-page/"
date: "2022-12-12T10:00:31+00:00"
modified: "2025-02-13T12:33:07+00:00"
author:
  name: "Dhiren Vasoya"
  url: "https://magecomp.com/"
categories:
  - "How To"
  - "Magento 2"
word_count: 259
reading_time: "2 min read"
summary: "Hello Magento Friends,"
description: "Check How to Change Default Sort Order from Ascending to Descending for Product Listing in Category Page in Magento 2."
keywords: "How To, Magento 2"
language: "en"
schema_type: "Article"
related_posts:
  - title: "How to Create Custom Table via XML In Magento 2.3"
    url: "https://magecomp.com/blog/how-to-create-custom-table-via-xml-in-magento-2/"
  - title: "Magento 2: How to Save Custom Attribute Value After Customer Register"
    url: "https://magecomp.com/blog/magento-2-save-custom-attribute-value-customer-register/"
  - title: "Magento 2: How to Override Template using Helper Function"
    url: "https://magecomp.com/blog/magento-2-override-template-using-helper-function/"
---

# Magento 2: How to Change Default Sort Order from Ascending to Descending for Product Listing in Category Page?

_Published: December 12, 2022_  
_Author: Dhiren Vasoya_  

![How to Change Default Sort Order from Ascending to Descending for Product Listing in Category Page in M2](https://magecomp.com/blog/wp-content/uploads/2022/12/How-to-Change-Default-Sort-Order-from-Ascending-to-Descending-for-Product-Listing-in-Category-Page-in-M2-1024x512.webp)

**Hello Magento Friends,**

In today’s blog, we will learn about How to Change Default Sort Order from Ascending to Descending in Magento 2.
[![Hire Magento Programmer](https://magecomp.com/blog/wp-content/uploads/2025/02/Hire-Magento-Programmer-CTA-1.webp)](https://magecomp.com/services/hire-magento-programmer/)

In Magento 2, the default product listing in the category page shows the default filter option in ascending to descending order. But if you want to set the sort order from descending to ascending, you can use the below steps.
## Steps to Change Default Sort Order from Ascending to Descending in Magento 2:
**Step 1:** Create **app\design\frontend\Themes\Yourtheme\Magento_Catalog\layout\catalog_category_view.xml** or you can override the **catalog_category_view.xml file** in your custom extension at the below location
**app\code\Vendor\Extension\view\frontend\layout\catalog_category_view.xml**
Now add the code as below
```
<?xml version="1.0"?>

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
	<referenceContainer name="content">
		<referenceBlock class="MagentoCatalogBlockProductListProduct" name="category.products.list">
			<action method="setDefaultDirection">
				<argument name="dir" xsi:type="string">desc</argument>
			</action>
		</referenceBlock>
	</referenceContainer>
    </body>
</page>
```

## [![Magento version upgrade](https://magecomp.com/blog/wp-content/uploads/2025/02/Magento-2-Version-Upgrade-CTA-2.webp)](https://magecomp.com/services/magento-upgrade-services/)

## Conclusion:
Hence, with the help of the above method, you can easily change the order of product listing in the category page from ascending to descending in Magento 2. To configure product listings in Magento 2 – [**Click Here!**](https://magecomp.com/blog/how-to-configure-product-listings-in-magento-2/)

Share your doubts with me through the comment section, and stay with us for more Magento solutions.
[![Magento Malware Removal](https://magecomp.com/blog/wp-content/uploads/2025/02/Magento-Malware-Removal-CTA-5.webp)](https://magecomp.com/magento-malware-removal.html)

**Happy Coding!**

</body>


---

_View the original post at: [https://magecomp.com/blog/magento-2-change-default-sort-order-from-ascending-to-descending-for-product-listing-in-category-page/](https://magecomp.com/blog/magento-2-change-default-sort-order-from-ascending-to-descending-for-product-listing-in-category-page/)_  
_Served as markdown by [Third Audience](https://github.com/third-audience) v3.5.3_  
_Generated: 2026-09-28 11:56:12 UTC_  
