Empty Magento 2 Category Pages Caused by Misconfigured Attributes
If category pages suddenly show no products and the logs show a collection query with NULL in its WHERE condition, work through these checks.
First, rule out the usual suspects
- Temporarily disable third-party modules.
- Confirm Elasticsearch or OpenSearch is running and reachable.
Then check attribute configuration
This query finds attributes whose settings do not match their backend type:
SELECT *
FROM catalog_eav_attribute cea
JOIN eav_attribute ea
ON ea.attribute_id = cea.attribute_id
AND backend_type IN ('text')
WHERE
cea.is_filterable = 1 OR cea.is_filterable_in_search = 1
If any appear, correct them:
UPDATE catalog_eav_attribute cea
JOIN eav_attribute ea
ON ea.attribute_id = cea.attribute_id
AND backend_type in ('text')
SET
cea.is_filterable = 0, cea.is_filterable_in_search = 0
WHERE
cea.is_filterable = 1 OR cea.is_filterable_in_search = 1
Reindex and clear caches
magento indexer:reindex magento cache:clean magento cache:flush
Need a second pair of eyes on this? Our team handles Magento development every week. See how we can help.