Building and Customizing XML Feeds
Deviking Product Feeds Pro allows you to create fully customizable XML product feeds from your WooCommerce catalog.
You can use a ready-made template for a supported channel or build your own XML structure from scratch.
This guide explains the main XML configuration options and how they affect the generated file.
Create or Edit an XML Feed
From your WordPress dashboard, go to:
Deviking Feeds → Add Feed
or open an existing feed from:
Deviking Feeds → Feeds
Set the feed format to:
XML
If you are using a ready-made template, select the required template and click Apply Template. The plugin will automatically configure the initial XML structure and Attribute Mapping for that destination.
Basic XML Structure
A typical XML product feed contains three main levels:
<?xml version="1.0" encoding="UTF-8"?>
<products>
<product>
<id>123</id>
<title>Example Product</title>
<price>29.90</price>
</product>
<product>
<id>124</id>
<title>Another Product</title>
<price>49.90</price>
</product>
</products>In this example:
productsis the Root Elementproductis the Product Elementid,titleandpriceare generated from the Attribute Mapping
Root Element
The Root Element wraps all product records in the XML document.
For example:
productsgenerates:
<products>
...
</products>You can change this value according to the XML specification required by the destination.
For example:
catalogwould generate:
<catalog>
...
</catalog>Product Element
The Product Element defines the XML node used for each individual WooCommerce product.
For example:
productgenerates:
<product>
...
</product>If the destination expects:
<item>
...
</item>set the Product Element to:
itemEach eligible product or variation is then written using that element.
Attribute Mapping
The Attribute Mapping section defines the XML elements contained inside each product record.
For example:
| Output Field | Source |
|---|---|
id | Product ID |
title | Product Name |
description | Description |
link | Product URL |
image | Featured Image |
price | Current Price |
sku | SKU |
This configuration can generate:
<product>
<id>123</id>
<title>Example Product</title>
<description>Product description</description>
<link>https://example.com/product/example-product/</link>
<image>https://example.com/uploads/product.jpg</image>
<price>29.90</price>
<sku>ABC-123</sku>
</product>Add a New XML Field
To add another element to each product record, add a new row to Attribute Mapping.
Enter the required XML element name and select the WooCommerce source that should provide its value.
For example:
Output Field: brand
Source: Attribute → Brandcan generate:
<brand>Example Brand</brand>You can add, remove, duplicate and reorder mapping rows as needed.
The order of the rows determines the order of the elements in the generated product record.
Select a Source
Each XML field can retrieve its value from a different source.
Available sources can include:
- product information;
- Product ID;
- SKU;
- product name;
- descriptions;
- prices;
- stock information;
- product URLs;
- images;
- categories;
- WooCommerce attributes;
- taxonomies;
- custom fields / post meta;
- parent-product values;
- static values.
This makes it possible to create XML feeds for both standard marketplaces and completely custom integrations.
Static Values
Not every XML field needs to come from WooCommerce.
You can use a static value when the same value should be written for every product.
For example:
Output Field: condition
Value: newgenerates:
<condition>new</condition>for every exported product.
Fallback Source
A Fallback Source can be configured when the primary source may be empty.
For example:
Primary Source: Description
Fallback Source: Short DescriptionIf the full description is empty, Product Feeds automatically uses the short description instead.
Another example:
Primary Source: SKU
Fallback Source: Product IDFallback values help prevent incomplete XML records.
Skip Empty Fields
Enable Skip if empty when an element should not appear at all if no value is available.
Without this option:
<brand></brand>With Skip if empty enabled, the element is omitted completely.
This is useful for optional fields and for destinations that do not accept empty XML elements.
Prefix and Suffix
You can add text before or after a source value.
For example:
Value: 25
Suffix: kgcan generate:
<weight>25 kg</weight>A prefix could be used in the same way:
Prefix: SKU-
Value: 12345Result:
<id>SKU-12345</id>Dynamic Prefix and Suffix Values
Product Feeds Pro can also use dynamic source placeholders inside Prefix and Suffix values.
This allows another product value to be inserted dynamically while the feed is being generated.
For example, a configuration can combine several product values into a single output field without modifying the original WooCommerce data.
Transform Values
Values can be transformed before they are written to the XML file.
Available operations include options such as:
- Trim
- Strip HTML
- Preserve HTML
- Lowercase
- Uppercase
- Limit characters
- Replace text
- Number Format
- Value Map
For example, a product title:
PREMIUM RUNNING SHOEScould be transformed before export if the destination requires a different format.
Transforms affect only the generated feed. They do not modify the WooCommerce product.
CDATA
XML fields containing descriptions, HTML or special characters may benefit from CDATA.
For example:
<description><![CDATA[
<p>Comfortable running shoes with breathable fabric.</p>
]]></description>CDATA tells the XML parser to treat the enclosed content as text rather than XML markup.
CDATA can be enabled individually for the mapping rows that require it.
You do not need to enable it for every field.
Nested XML Elements
Product Feeds Pro supports nested XML paths for destinations that require more complex structures.
For example, instead of:
<price>29.90</price>a destination may require:
<pricing>
<price>29.90</price>
<currency>EUR</currency>
</pricing>Nested paths allow you to create this type of hierarchy directly from the mapping configuration.
XML Attributes
Some XML specifications require values as attributes rather than child elements.
For example:
<price currency="EUR">29.90</price>or:
<product id="123">
<title>Example Product</title>
</product>Product Feeds Pro supports XML attributes where required by the destination structure.
Repeated Elements
Some XML specifications allow or require the same element to appear multiple times.
For example:
<product>
<image>image-1.jpg</image>
<image>image-2.jpg</image>
<image>image-3.jpg</image>
</product>Product Feeds Pro can create repeated XML elements when the feed specification requires them.
XML Namespaces
For more advanced feeds, you may need XML namespaces.
A feed could require a structure such as:
<rss xmlns:g="http://base.google.com/ns/1.0">and fields such as:
<g:id>123</g:id>
<g:title>Example Product</g:title>
<g:price>29.90 EUR</g:price>Product Feeds Pro supports namespace-based XML structures for feeds that require prefixed element names.
When you use a ready-made template, the required namespace configuration may already be included.
Custom XML Header
You can add custom content before the main XML root structure when required by an external specification.
The standard XML declaration is typically:
<?xml version="1.0" encoding="UTF-8"?>Some integrations may require additional declarations or custom header content.
Use the XML Header setting only when required by the destination specification.
Content Before Products
Product Feeds Pro can insert custom XML content before the generated product records.
For example:
<store>
<name>Example Store</name>
<url>https://example.com</url>
</store>This is useful when the destination requires metadata about the store or feed before the product collection begins.
Content After Products
Custom content can also be added after the generated product records.
For example:
<generated_by>Deviking Product Feeds</generated_by>The exact structure depends on the specification of the system receiving the XML feed.
Custom XML Footer
Custom content can also be added after the main XML structure when required.
Header and footer settings provide additional flexibility for integrations that require content outside the normal product structure.
Dynamic Tokens
Custom XML sections can use dynamic tokens.
Available tokens include:
{{timestamp}}Current generation timestamp.
{{generated_at}}Feed generation date and time.
A custom date format can also be used:
{{generated_at:Y-m-d H:i}}Other available tokens include:
{{site_name}}
{{site_url}}
{{site_description}}For example:
<generated>{{generated_at:Y-m-d H:i}}</generated>could produce:
<generated>2026-09-15 22:30</generated>Example Custom XML Feed
A custom feed could be configured to generate:
<?xml version="1.0" encoding="UTF-8"?>
<catalog>
<store>
<name>Example Store</name>