---
title: Import Product Categories
description: How to import product category assignments and main categories in Shopware 6 using categories_all_paths, categoryIds, and main_category_# columns.
---

You can import product categories using one of the following fields:

- `categories_all_paths` — contains the full category path from the root category. If a category doesn't exist in your store, our app will create it automatically.
- `categoryIds` — category UUIDs separated by a pipe symbol `|`

Here's an example of your store's structure:

![](/images/Screenshot_2025-02-16_at_13.35.38.png)

To assign a product to the `Women` category, use either:

| productNumber | categories_all_paths |
| --- | --- |
| FBPRD001 | Home/Shoes/Women |

or

| productNumber | categoryIds |
| --- | --- |
| FBPRD001 | 01949d590ee775e09a05e27a30b18875 |

To assign a product to multiple categories, separate them with a pipe symbol `|`:

| productNumber | categories_all_paths |
| --- | --- |
| FBPRD001 | Home/Shoes/Women\|Home/Accessories |

## Import Main Categories

Shopware lets you set one main category per sales channel for a product. The main category is used by Shopware for SEO URL generation and storefront breadcrumb behavior.

Use a dynamic column name with the sales channel after `#`:

- `main_category_#Storefront`
- `main_category_#98432def39fc4624b33213a56b8c944d`

The part after `#` can be the sales channel name or the 32-character sales channel ID. The value can be a category ID, a category path, or an unambiguous category name.

:::caution
The main category must already be assigned to the same product through `categories_all_paths`, `categoryIds`, or an existing product-category assignment. If the category is not assigned to the product, the app skips that main category value and logs a warning.
:::

Example with a category path:

| productNumber | categories_all_paths | main_category_#Storefront |
| --- | --- | --- |
| FBPRD001 | Home/Shoes/Women | Home/Shoes/Women |

Example with category and sales channel IDs:

| productNumber | categoryIds | main_category_#98432def39fc4624b33213a56b8c944d |
| --- | --- | --- |
| FBPRD002 | 01949d590ee775e09a05e27a30b18875 | 01949d590ee775e09a05e27a30b18875 |

If the `main_category_#...` value is empty, the app leaves the existing main category unchanged.

## Replace Product Categories

By default, our app uses append behavior, meaning categories from the import file are merged with existing product categories.

To replace existing categories instead, enable the **Replace product categories** option in the import profile settings. This will first remove all current product-category associations before importing new categories.

![](/images/Screenshot_2025-02-16_at_13.41.06.png)

> ☝ **Tip:** You can remove all product categories by enabling **Replace product categories** and using an empty `categories_all_paths` value.
