# CDATA in an XML feed – what it is and when to use it

> CDATA is a section of XML whose content is read as plain text. When to use it for descriptions with HTML or the & character, and the most common mistakes.

Source: <https://sortyra.com/glossary/cdata-in-xml-feed>

---

[Sortyra](https://sortyra.com/) [Glossary](https://sortyra.com/glossary) [A – D](https://sortyra.com/glossary/a-d)

# CDATA

Sortyra team · March 6, 2026 · 3 min read

[Glossary](https://sortyra.com/glossary)

[A – D](https://sortyra.com/glossary/a-d) [E – H](https://sortyra.com/glossary/e-h) [I – L](https://sortyra.com/glossary/i-l) [M – P](https://sortyra.com/glossary/m-p) [Q – T](https://sortyra.com/glossary/q-t) [U – X](https://sortyra.com/glossary/u-x)

- [301 redirect](https://sortyra.com/glossary/what-is-a-301-redirect)
- [Additional product images (additional_image_link)](https://sortyra.com/glossary/additional-image-link-feed)
- [Affiliate network](https://sortyra.com/glossary/what-is-an-affiliate-network)
- [Age group (age_group)](https://sortyra.com/glossary/age-group-attribute-google-feed)
- [AI content](https://sortyra.com/glossary/ai-generated-product-content)
- [AI Copilot](https://sortyra.com/glossary/what-is-ai-copilot)
- [API](https://sortyra.com/glossary/what-is-an-api)
- [Available quantity](https://sortyra.com/glossary/available-quantity-stock)
- [B2B and B2C](https://sortyra.com/glossary/b2b-vs-b2c-difference)
- [Bidding](https://sortyra.com/glossary/what-is-bidding-cpc)
- [Category taxonomy](https://sortyra.com/glossary/category-taxonomy-channels)
- [Category tree](https://sortyra.com/glossary/what-is-a-category-tree)
- [CATEGORYTEXT](https://sortyra.com/glossary/categorytext-heureka-category)
- [Channel specification](https://sortyra.com/glossary/feed-channel-specification)
- [Check digit](https://sortyra.com/glossary/gtin-check-digit-calculation)
- [Conversion](https://sortyra.com/glossary/what-is-a-conversion-ecommerce)
- [Conversion rate](https://sortyra.com/glossary/conversion-rate-formula-ecommerce)
- [CPC (cost per click)](https://sortyra.com/glossary/what-is-cpc-cost-per-click)
- [CSV](https://sortyra.com/glossary/what-is-a-csv-file)
- [CTR](https://sortyra.com/glossary/what-is-ctr-click-through-rate)
- [Currency in a feed](https://sortyra.com/glossary/currency-in-product-feed)
- [Custom label (custom_label)](https://sortyra.com/glossary/custom-label-google-feed)
- [Data channel](https://sortyra.com/glossary/input-and-output-data-channels)
- [Data export](https://sortyra.com/glossary/what-is-data-export)
- [Data import](https://sortyra.com/glossary/what-is-data-import-products)
- [Data mapping](https://sortyra.com/glossary/data-mapping)
- [Data matching](https://sortyra.com/glossary/data-matching-products-categories)
- [Data source](https://sortyra.com/glossary/data-source-input-feed)
- [Deeplink](https://sortyra.com/glossary/what-is-a-deeplink)
- [Delivery time (DELIVERY_DATE)](https://sortyra.com/glossary/delivery-date-heureka-delivery-time)
- [Dropshipping](https://sortyra.com/glossary/what-is-dropshipping)
- [Duplicate product](https://sortyra.com/glossary/duplicate-products-in-feed)
- [Dynamic ads](https://sortyra.com/glossary/dynamic-ads-from-product-catalogue)

CDATA is a special section in an XML file whose content is read as plain text, not as tags. It is mainly useful for product descriptions containing HTML or the & character, which would otherwise break the feed. The section starts with "<![CDATA[" and ends with "]]>".

**In this article**

1. What is CDATA
2. What it looks like in a feed
3. What it is used for
4. What to watch out for
5. How Sortyra helps
6. Related terms
7. Frequently asked questions

## What is CDATA

In [XML](https://sortyra.com/glossary/what-is-an-xml-file), some characters have a special meaning. The `<` character starts a tag and the `&` character starts a shorthand for a special character. If a product description contains "Tent & tarp" or an HTML tag `<p>`, the program thinks it is XML markup and won't read the file.

There are two solutions:

1. Write each such character as a replacement – `&` as `&amp;`, `<` as `&lt;`.
2. Wrap the whole text in a **CDATA** block (from _character data_).

CDATA works like an envelope marked "do not open, just pass on". The program doesn't analyse the content and takes it as it is. For the channel, both methods are equivalent – the result is the same text.

## What it looks like in a feed

`<!-- Heureka, Zboží: a description with HTML in a CDATA block --> <DESCRIPTION><![CDATA[<p>Tent for 2 people, tarp & groundsheet included.</p>]]></DESCRIPTION> <!-- Google Merchant: the same text with & replaced --> <g:description>Tent for 2 people, tarp &amp; groundsheet included.</g:description>`

The first line passes on the text, HTML tag included, unchanged; the second writes `&` as a replacement and needs no CDATA.

## What it is used for

- **Product descriptions with HTML** – paragraphs, lists and bold text from the online shop.
- **Titles and brands containing `&`**, for example "B&S" or "Mix & Match".
- **Texts with angle brackets** and links with parameters in an element's text.

CDATA is part of the XML standard, so comparison sites and Google can read it.

## What to watch out for

- **`]]>` must not appear inside.** This string ends the CDATA, and the rest of the text breaks the feed.
- **It doesn't work in attributes.** In an [attribute](https://sortyra.com/glossary/xml-attribute-in-feed) you must always use replacements such as `&amp;`.
- **It doesn't solve encoding.** CDATA won't fix broken accented characters or forbidden control characters – that is what correct [UTF-8 encoding](https://sortyra.com/glossary/utf-8-encoding-in-feed) is for.
- **HTML stays HTML.** CDATA only passes the tags on; a channel that doesn't support HTML in descriptions will show them as text or remove them. Check the channel's specification.
- **Blocks cannot be nested** one inside another.

## How Sortyra helps

When loading a supplier's feed, Sortyra takes CDATA content unchanged and corrects a lone `&` outside CDATA to `&amp;` so the reading doesn't stop. In outputs it writes special characters as replacements, so the resulting feed is valid XML even without CDATA.

## Related terms

- [XML](https://sortyra.com/glossary/what-is-an-xml-file)
- [Element (tag)](https://sortyra.com/glossary/xml-element)
- [XML attribute](https://sortyra.com/glossary/xml-attribute-in-feed)
- [Product description](https://sortyra.com/glossary/product-description-feed)
- More detail: [Common feed errors](https://sortyra.com/knowledge-base/common-feed-errors-how-to-fix)

## Frequently asked questions

### Do I have to put the product description in CDATA?

No. It is enough for the `&`, `<` and `>` characters to be written as replacements. CDATA is just a more convenient way for long texts with HTML.

### Why does the feed stop at the & character?

In XML, the `&` character starts a shorthand for a special character. A lone `&` is a markup error, and the program rejects the whole file because of it.

### Does Heureka accept CDATA?

Yes, CDATA is a standard part of XML and comparison sites read it routinely.

[← Previous article **CATEGORYTEXT**](https://sortyra.com/glossary/categorytext-heureka-category) [Next article → **Channel specification**](https://sortyra.com/glossary/feed-channel-specification)

## Try it on your own feed

[Try it free](https://app.sortyra.com/registracia?lang=en) [Book a 15-min call](https://sortyra.com/contact)
