How to Create Categories in Magento 2

Category pages divide your store’s inventory into manageable groups. This makes it easy for customers to navigate and shop.

Our tutorial will familiarize you with the product category hierarchy and show you how to create the root category and its subcategories in Magento 2. We’re using Magento 2.4.1, but these steps are the same for all Magento 2 versions.

Product Category Hierarchy in Magento 2

The category structure of a Magento catalog resembles an inverted tree, with the root at the top. The root expands into branches called the parent categories, further expanding into child categories.

In the following image, “Default Category” is the root category, and the rest of the categories, such as “What’s New” and “Women,” are the parent categories. Categories such as “Collection” and “Promotions” are grayed out because they are hidden or disabled.

Here’s an overview of the product category hierarchy of a Magento store below:

Product Category Hierarchy in Magento 2
Product Category Hierarchy in Magento 2

 

Root Category

A root category is a menu container with categories and subcategories. It stands at the top of the category hierarchy.

Magento has a Default Category, which is the root. This root category does not appear on the website menu and does not have a URL.

You can create a new root category with a new set of products or duplicate products from the existing root category. If you have a website with multiple stores, you can create and assign a new root category for each store.

Note that there can only be one active root category per store.

Category

Category, or parent category, is the category that appears under the root category. It displays at the top of the menu categories panel on the frontend and has a URL.

In Magento, all structural elements nested below the Root category are called Subcategories. So a parent category is called a subcategory, and so is a child category.

Subcategory

A subcategory is a division of the parent category and is also known as a child category. They help you group products based on matching attributes.

On the storefront, subcategories appear when you hover on a parent category, and they also have a URL.

How to Create Categories in Magento 2

  1. Go to Catalog > Categories in the Magento admin sidebar.

    Categories in the Magento admin sidebar
    Categories in the Magento admin sidebar

  2. Assign the category to All Store Views or choose a specific “Store View” by expanding the dropdown on the top left.

    All Store Views
    Assign the new category to a Scope

  3. Add a root category or a subcategory in this step by navigating to the category tree located on the left side.
    Add a root category or a subcategory
    Add a root category or a subcategory.

    Magento has a premade root category called theDefault Category.” You can directly start adding parent and child categories under the “Default Category.” If you want to create a new root category, click on the Add Root Category button and proceed to the next step.
    To create a parent category, click on the root category first and then the Add Subcategory button. Similarly, you can create a child category by clicking on the parent category first and then clicking the Add Subcategory button.

  4. On the “New Category” page, set the Enable Category option to Yes if you want the new category to be available immediately on the frontend.

    New Category page
    Enable Category option to Yes, Set Include in Menu to Yes, Insert Category Name, and then click Save

  5. Set Include in Menu to Yes if you want the new category to appear in the top navigation, which is the main menu of your store.
  6. Insert the name of the new category in the Category Name text area.
  7. Click the orange Save button located on the top right. You’ll now see the new category in the category tree.
  8. Expand the Content section and add the following details:
    Category Image: Add a category image by either uploading your image or selecting an image that exists in the Media Storage. This image appears at the top of the “Category” page.
    Description: Add content that best describes the category.
    Add CMS Block: Insert a static block on the “Category” page by selecting a CMS Block from the dropdown list. Then, click on Save again and proceed to the next step.

    Content section on New Category page
    Expand the Content section and add Category Image, Description, and CMS Block

  9. Expand the Category Permissions section and set the following permissions:
    Note that this section is available in Adobe Commerce only. Skip this part and proceed to the next step if you’re using Magento Open Source.
    Click on the New Permission button to create a new permissions rule.
    Add the appropriate Website if you have a multi-site installation.
    Select the applicable Customer Group where the permissions apply.
    Set permissions for Browsing Category, Display Product Prices, and Add to Cart.
    Click Save and continue to the “Display Settings” below.

    Category Permissions
    Source: Magento Docs

  10. Expand the Display Setting section and configure the following settings:
    Display Mode: Set the display mode to either option 一 Products only, Static block only, or Static block and products.
    Anchor: Enable “Anchor” to Yes if you wish to include the “Filter by Attribute” section in the Layered Navigation.
    Available Product Listing Sort By: To change the “Available Product Listing Sort By,” unselect the Use All checkbox and choose Product, Product Name, or Price.
    Default Product Listing Sort By: To change the “Default Product Listing Sort By,” unselect the Use Config Settings checkbox and choose Product, Product Name, or Price.
    Layered Navigation Price Step: To change the “Layered Navigation Price Step,” unselect the Use Config Settings checkbox and insert an incremental price value.
    Click Save to proceed.

    Display Settings in New Category page
    Expand the Display Setting section and configure Display Mode, Anchor, Available Product Listing Sort By, Default Product Listing Sort By, Layered Navigation Price Step, and then click on Save.

  11. Expand the Search Engine Optimization section and add the following details:
    URL: Enter a search engine-friendly URL that’s not too long and has the category name.
    Meta Title: Enter a unique title of fewer than 70 characters to indicate the category topic. It will appear in the title bar, browser tab, and SERP.
    Meta Keywords: Insert all the keywords relevant to the category and products that potential customers may use to find the products.
    Meta Description: Enter a compelling description that’s less than 155 characters. It will appear as a brief introduction in search engine results.

    SEO in New Category page
    Expand the Search Engine Optimization section and add URL, Meta Title, Meta Keywords, Meta Description, and then click on Save.

  12. Expand the Products in Category section and add products manually by selecting the corresponding checkboxes.
    You can also use the Search Filters at the top of each column to find the products.
    To display products that haven’t been added to the category yet, change Any in the first column dropdown to No and hit the Search button.
    Click on Save and continue.

    Products in Category in New Category page
    Expand the Products in Category section and add products to the category

  13. Expand the Design section and configure the following settings:
    Use Parent Category Settings: Enable it to Yes if you want to apply the parent category design settings to the new category.
    Theme: Select the theme from the dropdown list to apply the theme design to the category pages.
    Layout: Choose 1 out of the 5 layout options from the dropdown to apply the layout design to the category pages.
    Custom Layout Update: You’ll see No Update in the dropdown unless you’ve created a custom layout update file and placed it in the module or theme folder.
    Note: the “Layout Update XML” field has been removed in the 2.3.4 and above versions and replaced with the “Custom Layout Update.”
    Apply Design to Products: Set “Apply Design to Products” to Yes if you want to apply the same design on product pages.

    Design in New Category page
    Expand the Design section and configure Use Parent Category Settings, Theme, Layout, Custom Layout Update, and then click on Save

  14. Schedule a design update in the Schedule Design Update section using the From and To dates in the calendar.

    Schedule Design Update in New Category page
    Schedule a design update in the Schedule Design Update section

  15. Click Save on the top right.

That’s it! You’ve successfully created a category in Magento 2.

Categories in Magento 2
Categories in Magento 2

Liam is a marketing specialist at StartMarketing.net. Based in Dublin, he graduated from Trinity College Dublin in 2020 with a degree in Computer Science (Intelligent Systems). He has since 2021 worked for Google as a Sales and Marketing specialist, within their Dublin headquarters. Liam has over 4 years of experience in e-commerce sales, digital marketing and branding.

Leave a Comment