Magento 2 remove layered navigation

In this tutorial we will learn about a method in magento 2,Magento 2 remove layered navigation.Before starting the example i suppose you are familiar with magento 2 and are an advanced learner. If you are a beginner please start from the beginning.

Lets come to our topic.

Removing all categories

If you want to remove all the categories then add this code in your default.xml and add this to your theme or module.

 

default.xml

<referenceBlock name="catalog.leftnav" remove="true" />

 

Removing single category

Furthermore if you want to do this for single category you can do that from admin panel.For that,login to admin panel and then go to

Admin Panel > Products > Categories > YOUR PAGE > Design

  and add the following xml.

<referenceContainer name="catalog.leftnav" remove="true" />

That’s it from this tutorial. I hope it has help you in learning.

Qaisar Satti

Hi, I'm Qaisar Satti! I've been a developer for over 20 years, and now I love sharing what I've learned through tutorials and guides. Whether you're working with Magento, PrestaShop, or WooCommerce, my goal is to make your development journey a bit easier and more fun. When I'm not coding or writing, you can find me exploring new tech trends and hanging out with the amazing developer community. Thanks for stopping by, and happy coding!

2 thoughts on “Magento 2 remove layered navigation

Leave a Reply