Search by

infrangible / m2-catalog-attribute-filter-hidden

infrangible

Adds a "Filterable (hidden)" option for product attributes: products can be filtered by the attribute through links, while the filter stays invisible in layered navigation.

Package info

github.com/infrangible-dev/m2-catalog-attribute-filter-hidden

Homepage

Type:magento2-module

pkg:composer/infrangible/m2-catalog-attribute-filter-hidden

Statistics

Installs: 177

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

2.0.0 2026-12-02 21:14 UTC

This package is auto-updated.

Last update: 2026-12-02 21:18:20 UTC


README

Adds the option "Filterable (hidden)" to "Use in Layered Navigation" of product attributes: products can be filtered by the attribute through links, while the filter stays invisible in layered navigation.

Behavior

In Magento, an attribute is either shown in layered navigation or cannot be used to filter the product list. Links to pre-filtered product lists (campaigns, menu entries, landing pages) need the filter without offering it to the shoppers.

  • Stores > Attributes > Product, tab "Storefront Properties": the field "Use in Layered Navigation" gets the option "Filterable (hidden)", next to "No", "Filterable (with results)" and "Filterable (no results)". The column of the attribute grid shows it and can be filtered by it.
  • On category pages, an attribute with this option filters the products like a visible filter when its value is in the address, for example /gear/bags.html?brand=12 (the option ID of the value) or ?price=30-40 for a hidden price filter.
  • Layered navigation does not show the filter. If no other filter is left, Magento hides the block.
  • "Now Shopping by" does not show the active hidden filter, and "Clear All" keeps it, so shoppers cannot remove it by accident.
  • Search result pages use the attributes with "Use in Search Results Layered Navigation" set to "Yes". A hidden attribute filters there too if that field is "Yes"; its filter stays invisible in both cases.

Magento builds the search request of the category pages only with the attributes that are shown in layered navigation. The module adds the hidden attributes to it (filter and aggregation), so their links filter the products and Magento does not log "The bucket doesn't exist".

The filters are hidden in the layered navigation of Luma and of themes that use Magento's layered navigation block (Hyvä as well). The GraphQL API is not changed: it returns hidden attributes in the aggregations like other filterable attributes.

Requirements

  • Magento Open Source or Adobe Commerce 2.4.6 or newer
  • PHP 8.1 or newer

Installation

composer require infrangible/m2-catalog-attribute-filter-hidden
bin/magento module:enable Infrangible_CatalogAttributeFilterHidden
bin/magento setup:upgrade

In production mode, also run bin/magento setup:di:compile.

After changing "Use in Layered Navigation" of an attribute, reindex as usual and flush the cache: Magento keeps the search requests in the configuration cache.

License

Infrangible Catalog Attribute Filter Hidden is licensed under the MIT License - see the LICENSE file for details.