Magento – magento 2 : Remove catalog.leftnav from non anchored category page

layered-navigationlayoutmagento2

How to remove catalog.leftnav from Only Non Anchored Category page.
I have to required catalog.leftnav in Anchored category page only.

I have done code for that,
file path, app/design/frontend/Package/theme/Magento_Catalog/layout/catalog_category_view_type_default.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
            <referenceBlock name="catalog.leftnav" remove="true"/>                
    </body>
</page>

But Above code remove left sidebar from Anchor category page also.

Best Answer

i know this post is old, but i found a simple solution.

go to Backend > Products > Categories chose the category you want to remove catalog.leftnav from

then go to Design tab, inside Layout Update XML put <referenceContainer name="catalog.leftnav" remove="true"/>

this should remove catalog.leftnav from that category only.