In the previous Magento 2 user guide we learned how to create product pages; now it is time for a more advanced store hierarchy user guide. In this article, you will learn how to add and modify different types of categories in Magento 2 admin panel.
Table of contents:
There are three main types of categories in Magento 2: basic category, hidden category and root category. We will begin with the basic one.
How to add a category in Magento 2
1.Log in to the admin panel and open the side menu of the Catalog tab. Select Categories from the list.
You’ll get to the following page; on the left will be the structure of your future categories and subcategories.
2. Click Add Subcategory.
3. Fill in the Basic Information:
- Enable Category – if you wish it to be immediately active in the store, set at Yes
- Include in Menu – if you wish it to be included in the menu, set at Yes.
- Category Name for store view.
As you click Save in the upper right corner, the category will already appear in the categories tree if you configured it this way.
4. Open the Content tab. Here you can:
- upload the Category Image,
- add the Description for store view,
- select a CMS Block if you wish a content block to appear at the category landing page. Choose which one from the following drop-down menu.
5. Proceed to the Display Settings. Here you need to configure:
- Display Mode: Products Only / Static Block Only / Static Block and Products,
- Anchor – enable to add to the category the “Filter by Attribute”,
- Available Product Listing Sort By – you can either leave the tick at the Use All or select one option from the following list,
- Default Product Listing Sort By – either leave Use Config Settings or choose from Position, Product Name or Price,
- Layered Navigation Price Step – either leave Use Config Settings or set up a certain value.
Click Save to continue.
6. Open the Search Optimization tab. In order to increase your search rankings, fill in:
- Meta Title – it appears in the title bar and browser tab as well as in the search results. It should be less than 70 characters in length and unique.
- Meta Keywords – relevant word combinations the potential visitors may use to search for the products in this category.
- Meta Description – the description search engines index and show in the search results below the page title. The perfect length of a meta description is 150-160 characters.
Click Save to keep the changes.
7. Open Products in Category tab.
Here you will need to add products by ticking them. If you have too many items in the store to select them manually, you can always apply to them Search Filters, located at the top of each category. To clear all filter fields, click Reset Filter.
8. Go to Design tab.
- Enable Use Parent Category Settings and it will be automatically applied to the current category,
- Theme to apply to the category,
- Layout to select the column layout to apply to the category,
- Fill in Layout Update XML code if you have a custom one,
- Apply Design to Products – Yes or No.
9. Proceed to the final tab Schedule Design Update.
Here you set up the date range when your custom design will apply to a certain category.
- You can move the category or subcategory position by a simple drag-and-drop in the categories tree.
- To delete a category, find the Delete button near the Save one in the upper right corner and click it. The system will warn you with the following notification: “Are you sure you want to delete this category?”.
How to add a hidden category in Magento 2
A hidden category doesn’t appear in the store menu and is visible only from the admin panel. Such categories allow you to create your own store structure, which will look different on the outside to the visitors and customers.
1. Navigate to Catalog -> Categories.
2. Select the category you want to make hidden and click on it.
3. Set the Include in Menu to No.
4. In Display Settings tab set Anchor to No. Click Save.
Now the category is hidden – it is not reflected in the main menu. However, you still can add active subcategories in the hidden category. For this, perform the reverse actions at the hidden category’s subcategory – set Include in Menu at Yes and Anchor at No. Click Save in the upper right corner.
How to add a root category in Magento 2
Imagine your online store is a tree. Products, in this case, correspond to the leaves – numerous standalone entities with unique properties, and categories will be branches – they separate leaves into certain uniform groups. Still, we need a tree trunk for our tree to be complete, and in Magento 2 store this role is carried out by a root category.
A root category is basically a container for the store’s hierarchy of categories and subcategories, and a single store can have only one active root category. Although a root has a name, it does not appear on the website’s menu and, accordingly, does not have a URL.
To add a root category:
1. Navigate to Catalog -> Categories.
2. Click the Add Root Category button in the left corner of the page.
3. Complete the basic configurations, like:
- Enable Category,
- Include in Menu,
- Category Name.
If you enable the first two points, you can already see your new root category in the tree on the left.
4. Proceed to add subcategories in your root category by simply clicking Add Subcategory.
If you are not satisfied with the default navigation capabilities of Magento 2, you can always improve your webstore navigation and make it more user-friendly with this great module from BelVG Subcategories extension by BelVG.
Wrapping it up
Categories are beneficial to an online store from every perspective: they properly arrange products, serve as a great navigation tool and are good for search engine optimization (SEO). The main principle of categories management is to strictly maintain the hierarchy of categories and subcategories. And in all the rest, category management in Magento 2 is a rather simple task.
For more useful modules from BelVG, go to our store.