{"id":23258,"date":"2024-02-16T12:29:05","date_gmt":"2024-02-16T12:29:05","guid":{"rendered":"https:\/\/ecommerce.folio3.com\/blog\/?p=23258"},"modified":"2024-02-16T12:30:40","modified_gmt":"2024-02-16T12:30:40","slug":"how-to-configure-customize-and-disable-layered-navigation-in-magento-2","status":"publish","type":"post","link":"https:\/\/ecommerce.folio3.com\/blog\/how-to-configure-customize-and-disable-layered-navigation-in-magento-2\/","title":{"rendered":"How to Configure, Customize, and Disable Layered Navigation in Magento 2"},"content":{"rendered":"<p><span style=\"font-weight: 400;\">In Magento 2, layered navigation is an essential feature that allows customers to filter products based on various attributes like color, size, price, etc. You can configure, customize, and disable layered navigation using the Magento Admin Panel.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Magento 2 Layered Navigation is a site tree and channel that permits customers to look through items more handily. Store administrators can set it up in the left section or in the bar over the page.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Due to layered navigation magento 2 , users can look for reasonable items in an efficient manner. For instance, when a customer visits your site to search for shoes, he can utilize the filter with product attributes, for example, brand name, size, color, and cost.<\/span><\/p>\n<h2><b>Here&#8217;s a step-by-step guide<\/b><\/h2>\n<h3><b>Precondition:<\/b><\/h3>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">You need access to the Magento Admin Panel with appropriate permissions to make configuration changes.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Understand how products and attributes are managed within the Magento catalog. This includes creating and managing attributes that you intend to use for layered navigation.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Understand the different settings available for attributes, particularly the Use in Layered Navigation setting, which determines whether an attribute is available for layered navigation.<\/span><\/li>\n<\/ul>\n<h2><strong>1. Configure Magento 2 Layered Navigation:<\/strong><\/h2>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Log in to your Magento Admin Panel.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Go to <\/span><b>Stores &gt; Configuration<\/b><span style=\"font-weight: 400;\">.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Under <\/span><b>Catalog<\/b><span style=\"font-weight: 400;\">, select <\/span><b>Catalog<\/b><span style=\"font-weight: 400;\"> again.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Expand the <\/span><b>Layered Navigation<\/b><span style=\"font-weight: 400;\"> section.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Configure options like:<\/span>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><b>Display Product Count:<\/b><span style=\"font-weight: 400;\"> Choose whether to display the number of products next to each filter option.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><b>Price Navigation Step Calculation:<\/b><span style=\"font-weight: 400;\"> Configure the price ranges for the price filter.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><b>Allow Multiple Select:<\/b><span style=\"font-weight: 400;\"> Decide whether customers can select multiple options within a filter.<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2><strong>2. Customize Magento 2 Layered Navigation Filters:<\/strong><\/h2>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Navigate to <\/span><b>Stores &gt; Attributes &gt; Product<\/b><span style=\"font-weight: 400;\">.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Choose the attribute you want to customize for layered navigation (e.g., color, size).<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Edit the attribute.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">In the <\/span><b>Storefront Properties<\/b><span style=\"font-weight: 400;\"> tab, ensure that the option <\/span><b>Use in Layered Navigation<\/b><span style=\"font-weight: 400;\"> is set to <\/span><b>Filterable (with results)<\/b><span style=\"font-weight: 400;\"> or <\/span><b>Filterable (no results)<\/b><span style=\"font-weight: 400;\"> depending on your preference.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Save the attribute.<\/span><\/li>\n<\/ul>\n<h2><strong>3. Customize the Layered Navigation Magento 2 Template (Optional):<\/strong><\/h2>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">You may want to customize the appearance of the layered navigation in your Magento theme.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Locate the template file responsible for rendering layered navigation. This is typically found in <\/span><b>app\/design\/frontend\/{Vendor}\/{Theme}\/Magento_LayeredNavigation\/templates<\/b><span style=\"font-weight: 400;\">.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Customize the template file according to your requirements.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Be cautious when customizing templates and consider creating a child theme to avoid losing changes during theme updates.<\/span><\/li>\n<\/ul>\n<h2><strong>4. Disable Magento 2 Layered Navigation:<\/strong><\/h2>\n<p><span style=\"font-weight: 400;\">Layered navigation is an exceptionally helpful component of Magento. In any case, if for some reason you want to disable it, there are a few things that you can do.<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">One can edit their categories and ensure they are not anchored. To do this, in the admin panel of your Magento go to <\/span><b>Catalog&gt;Manage Categories<\/b><span style=\"font-weight: 400;\">, then select the category on the left, <\/span><b>Display Settings tab<\/b><span style=\"font-weight: 400;\">, and from the settings that appear make sure that the <\/span><b>Is Anchor<\/b><span style=\"font-weight: 400;\"> option is set to No. however, subcategories will still be shown in the layered navigation menu on the front end with this approach.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">If you want to disable layered navigation altogether:<\/span><\/li>\n<\/ul>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Add this to your theme default.xml<\/span>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"3\">\n<pre><span style=\"font-weight: 400;\">&lt;referenceBlock name=\"catalog.leftnav\" remove=\"true\" \/&gt;<\/span><\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Or<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Add the file <\/span><b>catalog.xml<\/b> <span style=\"font-weight: 400;\">into your theme<\/span><\/li>\n<\/ul>\n<p><b>public_html\/app\/design\/frontend\/base\/default\/layout\/catalog.xml<\/b><span style=\"font-weight: 400;\">. In the file find and comment the following code:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">&lt;reference name=\"left\"&gt;<\/span>\r\n\r\n<span style=\"font-weight: 400;\">&lt;block type=\"catalog\/layer_view\" name=\"catalog.leftnav\"\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">after=\"currency\" template=\"catalog\/layer\/view.phtml\"\/&gt;<\/span>\r\n\r\n<span style=\"font-weight: 400;\">&lt;\/reference&gt;<\/span><\/pre>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">To remove layered navigation from search<\/span>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"3\">\n<pre><span style=\"font-weight: 400;\">&lt;referenceBlock name=\"catalogsearch.leftnav\" remove=\"true\" \/<\/span><\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">You can also disable specific attributes from appearing in layered navigation by editing their properties as mentioned in step 2 and setting <\/span><b>Use in Layered Navigation<\/b><span style=\"font-weight: 400;\"> to <\/span><b>No<\/b><span style=\"font-weight: 400;\">.<\/span><\/li>\n<\/ul>\n<h2><strong>5. Reindex and Clear Cache:<\/strong><\/h2>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">After making any changes to the layered navigation configuration or attributes, it&#8217;s important to reindex your Magento store and clear the cache to ensure that changes take effect properly.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">You can reindex and clear cache from the command line or through the Magento Admin Panel <\/span><b>(System &gt; Tools &gt; Index Management and System &gt; Cache Management)<\/b><span style=\"font-weight: 400;\">.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">By following these steps, you can configure, customize, and disable layered navigation in Magento 2 according to your requirements.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The frontend category page displays layered navigation in Magento 2 store:<\/span><\/p>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter wp-image-23259 size-full\" src=\"https:\/\/ecommerce.folio3.com\/blog\/wp-content\/uploads\/2024\/02\/1.png\" alt=\"Layered Navigation Magento 2\" width=\"975\" height=\"721\" srcset=\"https:\/\/ecommerce.folio3.com\/blog\/wp-content\/uploads\/2024\/02\/1.png 975w, https:\/\/ecommerce.folio3.com\/blog\/wp-content\/uploads\/2024\/02\/1-300x222.png 300w, https:\/\/ecommerce.folio3.com\/blog\/wp-content\/uploads\/2024\/02\/1-768x568.png 768w\" sizes=\"(max-width: 975px) 100vw, 975px\" \/><\/p>\n<h2><b>Conclusion<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">Magento 2 layered navigation offers a powerful tool for enhancing the user experience and improving product discoverability on your e-commerce store. Layered navigation in magento 2 is a valuable feature that can significantly enhance your store&#8217;s usability and customer satisfaction when implemented thoughtfully. By leveraging its customization options and monitoring its impact on performance and SEO, you can create a seamless browsing experience that drives conversions and fosters customer loyalty.<\/span><\/p>\n<h2><b>FAQs<\/b><\/h2>\n<h3><b>Q: Remove Magento 2 Layered navigation?<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">1) Go to the command line, where Magento is and run <\/span><b>php bin\/magento module:uninstall Magento_LayeredNavigation<\/b><\/p>\n<p><span style=\"font-weight: 400;\">2) Remove the old cache\/and generated content: <\/span><b>rm -rf var\/cache\/* pub\/static\/frontend generated\/code\/*<\/b><\/p>\n<p><span style=\"font-weight: 400;\">3) Re-Index: <\/span><b>php bin\/magento index:reindex<\/b><\/p>\n<p><span style=\"font-weight: 400;\">4) If needed, clear the cache and refresh.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">on the off chance that you miss it and need it back, or if removing causes problems, then re-enable it using:<\/span><\/p>\n<p><b>php bin\/magento module:enable Magento_LayeredNavigation<\/b><\/p>\n<h3><b>Q: What is the default Layered navigation in Magento 2?<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">The default layered navigation in Magento 2 is a bunch of filters (like color, size, price, and brand) that customers use to make more exact searches. It&#8217;s ordinarily found on the left section of category pages and search results.\u00a0<\/span><\/p>\n<h3><b>Q: How to enable Magento 2 Layered navigation?<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Follow these steps to enable layered navigation in Magento 2:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Log in to your Magento Admin Panel.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Go to <\/span><b>Stores &gt; Configuration<\/b><span style=\"font-weight: 400;\">.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Under <\/span><b>Catalog<\/b><span style=\"font-weight: 400;\">, select <\/span><b>Catalog<\/b><span style=\"font-weight: 400;\"> again.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Expand the <\/span><b>Layered Navigation<\/b><span style=\"font-weight: 400;\"> section.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Set <\/span><b>\u201cYes\u201d for Display Product Count<\/b><span style=\"font-weight: 400;\"> to show the number of products found for each attribute<\/span><\/li>\n<\/ul>\n<p><b>Save<\/b><span style=\"font-weight: 400;\"> the configuration<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In Magento 2, layered navigation is an essential feature that allows customers to filter products based on various attributes like color, size, price, etc. You can configure, customize, and disable layered navigation using the Magento Admin Panel. Magento 2 Layered Navigation is a site tree and channel that permits customers to look through items more<\/p>\n","protected":false},"author":45,"featured_media":23260,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[27],"tags":[254],"class_list":{"0":"post-23258","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-magento","8":"tag-layered-navigation-in-magento-2"},"acf":[],"featured_image_data":{"src":"https:\/\/ecommerce.folio3.com\/blog\/wp-content\/uploads\/2024\/02\/5597674_56615-scaled.jpg","alt":"Layered Navigation in Magento 2","caption":"laptop calendar cardboard box map fast delivery business vector illustration"},"_links":{"self":[{"href":"https:\/\/ecommerce.folio3.com\/blog\/wp-json\/wp\/v2\/posts\/23258"}],"collection":[{"href":"https:\/\/ecommerce.folio3.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ecommerce.folio3.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ecommerce.folio3.com\/blog\/wp-json\/wp\/v2\/users\/45"}],"replies":[{"embeddable":true,"href":"https:\/\/ecommerce.folio3.com\/blog\/wp-json\/wp\/v2\/comments?post=23258"}],"version-history":[{"count":0,"href":"https:\/\/ecommerce.folio3.com\/blog\/wp-json\/wp\/v2\/posts\/23258\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ecommerce.folio3.com\/blog\/wp-json\/wp\/v2\/media\/23260"}],"wp:attachment":[{"href":"https:\/\/ecommerce.folio3.com\/blog\/wp-json\/wp\/v2\/media?parent=23258"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ecommerce.folio3.com\/blog\/wp-json\/wp\/v2\/categories?post=23258"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ecommerce.folio3.com\/blog\/wp-json\/wp\/v2\/tags?post=23258"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}