Knowledge Base
Deviking Product feeds Pro

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-Shirts
 

A 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-Shirts
 

the exported value would be based on the parent category:

 
Clothing
 

Example 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-Shirts
 

the result would be:

 
T-Shirts
 

Example:

 
<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-Shirts
 

can be exported as:

 
Clothing > Men > T-Shirts
 

Example 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-Shirts
 

A destination may require a different separator, such as:

 
/
 

producing:

 
Clothing / Men / T-Shirts
 

Use 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:

  1. Open Deviking Feeds → Feeds.
  2. Edit the required feed.
  3. Go to Mapping.
  4. Add a new mapping row.
  5. Enter the output field required by the destination.
  6. Select one of the Product Category sources.
  7. Preview the feed.
  8. Save and generate the feed.

For example:

 
Output Field: category
Source: Category Path
 

could 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:

 
category
 

You can use whatever field name the destination requires.

For example:

 
product_category
 
 
category_path
 
 
google_product_category
 
 
merchant_category
 

The 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 Path
 

WooCommerce hierarchy:

 
Electronics
└── Computers
    └── Laptops
 

Generated 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-Shirts
 

Variation:

 
Premium T-Shirt - Black / Large
 

can 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 Shoes
 

while the destination expects:

 
Apparel & Accessories > Shoes > Athletic Shoes
 

or an external category ID such as:

 
2271
 

In 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 Path
 

sources automatically use the mapped category values for that feed.

For example:

WooCommerce:

 
Shoes
└── Running Shoes
 

Mapped values:

 
Shoes
→ Apparel & Accessories > Shoes

Running Shoes
→ Athletic Shoes
 

The 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:
2271
 

The 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 Shoes
 

Return empty value

No category value is returned.

Use static fallback value

For example:

 
Other
 

or:

 
9999
 

This 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 Shoes
 

Feed A:

 
Apparel & Accessories > Shoes > Athletic Shoes
 

Feed B:

 
Sports > Running > Footwear
 

Feed C:

 
2271
 

Your WooCommerce category remains:

 
Running Shoes
 

A 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 OutputRecommended Source
ClothingParent Category
T-ShirtsChild Category
Clothing > Men > T-ShirtsCategory Path
External category nameCategory Mapping
External category IDCategory 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.