
Magento 2 categories group products that share similar qualities or attributes. They logically structure your website and make it easier to navigate through.
Online shops are ever-changing so categories are rarely static. You may need to enable, disable, hide, or regroup them to keep data relevant.
This is exactly what we'll cover in this guide. You'll learn how to hide categories in Magento 2 using different methods effectively.
How to Hide Empty Categories in Magento 2?
Empty categories do no good and make the customer journey quite abrupt. This is one of the most common reasons for hiding them.
At the same time, it's difficult to monitor such categories manually, especially if you have many products. There's not much you can do by default.
Yet, the
has a more feasible option.It allows you to hide empty categories automatically in a few easy steps. To do so:
1. Navigate to Catalog > Categories and select the category you want to hide automatically.
2. Unfold the Dynamic Category section and enable the Automatically Disable Categories Without Products option.
Save your changes and that's about it. The cron will check if there are empty categories and disable them if any. You will receive a corresponding notification to stay updated on this.
But won't the category page throw the 404 error? This is a great question.
The Dynamic Category Extension has you covered. It creates 301 redirects for disabled categories by default. So it redirects shoppers to the corresponding active parent categories and shows the following notification.
If there are no parent categories, customers are redirected to the homepage instead.
So, you can hide categories in Magento with little to no manual work. It saves you tons of time you can spend on other important tasks.
How to Hide Categories in Magento Manually?
You may have other reasons for hiding categories in Magento. Perhaps, you don't want to show them in the navigation menu. Or some specific category is more irrelevant at the moment.
Thus, you should know how to hide categories in Magento manually. Here is what you should do:
1. Go to Catalog > Category and select a category you'd like to hide.
2. Switch the Enable Category and Include in Menu options to No.
3. Unfold the Display Settings section and disable the Anchor option.
Once done, don't forget to Save your changes. Just like that a category becomes inactive and hidden on the storefront.
At the same time, the subcategories of the disabled category remain active. You can include them in the navigation menu, make them anchor, and use them as usual.
So, you can hide categories in Magento both manually and automatically. The former is best for large catalogs, while the latter works well for the occasional one-time purposes.
Yet, you can optimize the catalog management even more by creating Magento categories automatically. Just imagine how effective your catalog management can get!