Controlling Product Category Output in Your Feed
WooCommerce products can belong to nested categories, and different feed destinations may require different parts of that category structure.
Deviking Product Feeds Pro provides dedicated category sources that let you export the top-level category, the most specific category, or the complete category path. You can also combine these sources with Category Mapping when an external platform requires its own category names or IDs.
Available Category Sources
Open your feed and go to the Mapping section.
When selecting a source for a mapping field, the Product Categories group includes:
- Parent Category
- Child Category
- Category Path
These category sources can be used in both XML and CSV feeds.
Consider the following WooCommerce category structure:
Clothing
└── Men
└── T-ShirtsA product assigned to this hierarchy can be represented in several different ways depending on the selected source.
Parent Category
Use Parent Category when the feed should contain the highest-level category.
Using the previous example:
Clothing
└── Men
└── T-Shirtsthe exported value would be based on the parent category:
ClothingExample XML:
<category>Clothing</category>Example CSV:
sku,category
TSHIRT-001,"Clothing"This is useful when the destination expects a broad product classification rather than the complete WooCommerce hierarchy.
Child Category
Use Child Category when you need the most specific category in the resolved category hierarchy.
For:
Clothing
└── Men
└── T-Shirtsthe result would be:
T-ShirtsExample:
<category>T-Shirts</category>This is useful when the receiving platform expects the most detailed category classification.
Category Path
Use Category Path when the complete WooCommerce category hierarchy should be exported.
For example:
Clothing
└── Men
└── T-Shirtscan be exported as:
Clothing > Men > T-ShirtsExample XML:
<category>Clothing > Men > T-Shirts</category>or CSV:
sku,category
TSHIRT-001,"Clothing > Men > T-Shirts"The category path is particularly useful for systems that need to understand the complete relationship between parent and child categories.
Configure the Category Path Separator
When using Category Path, the hierarchy is joined using the feed’s configured category separator.
A typical value is:
>which produces:
Clothing > Men > T-ShirtsA destination may require a different separator, such as:
/producing:
Clothing / Men / T-ShirtsUse the exact format required by the destination receiving the feed.
The configured separator is also preserved when Category Mapping is used to construct category paths.
Add a Category to Your Feed
To include category information:
- Open Deviking Feeds → Feeds.
- Edit the required feed.
- Go to Mapping.
- Add a new mapping row.
- Enter the output field required by the destination.
- Select one of the Product Category sources.
- Preview the feed.
- Save and generate the feed.
For example:
Output Field: category
Source: Category Pathcould generate:
<category>Electronics > Computers > Laptops</category>The Output Field Can Use Any Name
The XML element or CSV column does not need to be called:
categoryYou can use whatever field name the destination requires.
For example:
product_categorycategory_pathgoogle_product_categorymerchant_categoryThe Output Field controls the name written to the feed, while the Source determines which WooCommerce category value is used.
Example XML Configuration
Mapping:
Output Field: category
Source: Category PathWooCommerce hierarchy:
Electronics
└── Computers
└── LaptopsGenerated output:
<product>
<sku>LAPTOP-001</sku>
<title>Example Laptop</title>
<category>Electronics > Computers > Laptops</category>
</product>Example CSV Configuration
The same configuration in CSV could generate:
sku,title,category
LAPTOP-001,"Example Laptop","Electronics > Computers > Laptops"Category sources work independently of whether the feed format is XML or CSV.
Categories for Product Variations
WooCommerce variations generally use the category structure of their parent variable product.
Deviking Product Feeds handles this automatically: when a variation is being exported, the built-in category sources resolve the categories from its parent product.
For example:
Parent:
Premium T-Shirt
Category:
Clothing > Men > T-ShirtsVariation:
Premium T-Shirt - Black / Largecan still output:
<category>Clothing > Men > T-Shirts</category>You do not need to assign WooCommerce categories separately to every variation.
Using Category Mapping
Sometimes the WooCommerce category itself is not the value that should appear in the feed.
For example, your store may use:
Running Shoeswhile the destination expects:
Apparel & Accessories > Shoes > Athletic Shoesor an external category ID such as:
2271In this situation, use:
Deviking Feeds → Category Mapping
Category Mapping lets you convert WooCommerce categories into external category names or IDs without changing the categories in your store.
Category Mapping and Category Sources
When a Category Mapping is assigned to a feed, the built-in:
Parent Category
Child Category
Category Pathsources automatically use the mapped category values for that feed.
For example:
WooCommerce:
Shoes
└── Running ShoesMapped values:
Shoes
→ Apparel & Accessories > Shoes
Running Shoes
→ Athletic ShoesThe resulting feed can use the mapped values while your original WooCommerce category structure remains unchanged.
Using External Category IDs
If a marketplace requires category IDs rather than category names, enter the required ID as the Mapped Value in Category Mapping.
For example:
WooCommerce Category:
Running Shoes
Mapped Value:
2271The feed can then output:
<category>2271</category>This is preferable to modifying your actual WooCommerce category name just to satisfy an external feed specification.
Handling Unmapped Categories
Each Category Mapping can define what happens when a WooCommerce category has not been mapped.
Available fallback behaviors include:
Use original WooCommerce category name
Example:
Running ShoesReturn empty value
No category value is returned.
Use static fallback value
For example:
Otheror:
9999This gives you control over products whose categories have not yet been manually mapped.
Category Mapping Is Feed-Specific
A category map can be assigned to one or more feeds.
This means the same WooCommerce catalog can export different category values depending on the destination.
For example:
WooCommerce:
Running ShoesFeed A:
Apparel & Accessories > Shoes > Athletic ShoesFeed B:
Sports > Running > FootwearFeed C:
2271Your WooCommerce category remains:
Running ShoesA feed can have one active Category Mapping at a time; assigning it to another map replaces the previous map assignment for that feed.
Parent, Child or Full Path?
A simple way to choose the correct source is:
| Required Output | Recommended Source |
|---|---|
Clothing | Parent Category |
T-Shirts | Child Category |
Clothing > Men > T-Shirts | Category Path |
| External category name | Category Mapping |
| External category ID | Category Mapping |
Always follow the specification provided by the destination platform.
Preview the Category Output
Before generating the complete feed, use Preview and check products from different parts of your catalog.
Verify that:
- the correct category level is being exported;
- the complete path is correct when using Category Path;
- the separator matches the destination requirements;
- mapped categories contain the expected external values;
- products with unmapped categories use the intended fallback;
- variations receive their parent product categories correctly.
When the output looks correct, use:
Save & Generate
to create the final feed.