Magento 2 SQL queries › Store setup
Which attributes are used as filters on category pages?
Short answer: The filter settings are in catalog_eav_attribute: is_filterable for category pages and is_filterable_in_search for search results.
In the Magento admin
- Go to Stores › Attributes › Product, open each attribute, and check Use in Layered Navigation on the Storefront Properties tab.
With one query
These queries only read data. Run them on a copy of your database if you can, or ask your developer to. If your tables have a prefix (set in app/etc/env.php), add it to each table name.
Works on Magento Open Source and Adobe Commerce:
SELECT a.attribute_code, a.frontend_label,
CASE ca.is_filterable WHEN 1 THEN 'with results' WHEN 2 THEN 'all options' END AS layered_navigation,
ca.is_filterable_in_search, ca.position
FROM catalog_eav_attribute ca
JOIN eav_attribute a ON a.attribute_id = ca.attribute_id
WHERE ca.is_filterable > 0
ORDER BY ca.position, a.attribute_code;
Good to know
- A filter also needs the category to be an Anchor category, and products with values, to appear.