3

I would link to remove all the layered navigation filters from left side of Magento 2, using xml Please guide me

1
  • Can anybody provide a full list of referanceContainer names that can be removed/positioned Commented Nov 21, 2019 at 15:05

5 Answers 5

16

Add this to your theme default.xml

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

OR

Add this on Admin Panel > Products > Categories > YOUR PAGE > Design

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

enter image description here

Reference

5

You can do this by just admin category settings.

In admin panel of your Magento, go to Products > Categories, then select the category on the left.

Now on the right side, select Display Settings tab, and from the settings that appear make sure that the Is Anchor option is set to No.

Do this for all categories you want to hide Layered navigation from. Clear Cache and do re-index if required.

1
  • @parasarora1303: Does this helps to solve ? Commented Jul 28, 2016 at 12:12
3

To remove layered navigation from search

<referenceBlock name="catalogsearch.leftnav" remove="true" />
0

To remove this via Layout Update XML in the CMS (Products > Categories > Design) use

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

Note it has to be referenceContainer and not referenceBlock when used here.

-1

Well you could remove it's 'module' completely altogether from the system without any tweaking:

NOTE: Please be extremely careful with this procedure, as it can break things, if it does, then please check my last comment-line below to restore.

1) Go to the command line, where Magento is.

2) run:

php bin/magento module:uninstall Magento_LayeredNavigation

3) Confirm (Yes, Yes,... )

4) Remove the old cache/and generated content:

rm -rf var/cache/* pub/static/frontend generated/code/*

5) Re-Index:

php bin/magento index:reindex

6) Clear the cache:

php bin/magento index:reindex

4) If needed, clear the cache and refresh.


if you miss it, and want it back, or if removing causes problems, then re-enable it using:

php bin/magento module:enable Magento_LayeredNavigation

I hope this helps.

Regards Heider

1
  • Would it be preferable to disable the module with php bin/magento module:disable Magento_LayeredNavigation rather than removing it?
    – gnicko
    Commented May 11, 2022 at 14:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.