Support

Search results for ""

Sorry, no results found. Perhaps you would like to search the documentation?
All Topics
Matt Wenner

Bug: ACF WYSIWYG field exports plain text instead of raw HTML

**Title:** ACF WYSIWYG field exports plain text instead of raw HTML — display formatter StripTags incorrectly runs during export

**Plugin version:** 7.0.15

**Component:** addons/acf/classes/Export/FormatterFactory.php

**Description:**

When exporting a column backed by an ACF WYSIWYG field, the exported value is plain text with all HTML stripped. The raw HTML content is expected.

**Root cause:**

Export\FormatterFactory::create() has no explicit case for FieldType::TYPE_WYSIWYG, so it falls through to the default branch, which builds the export pipeline from $formatters — the full display formatter collection. For wysiwyg fields, that collection includes AC\Formatter\StripTags (added by Value\ValueFormatterFactory for on-screen rendering). This causes HTML to be stripped during export even though get_field() is called with $format_value = false and correctly returns raw HTML.

**Pipeline that runs for wysiwyg export (current, incorrect):**
`
GetFieldRaw($meta_key, false) → StripTags → StringSanitizer (internally runs StripTags again) → Separator
`

**Expected pipeline:**
`
GetFieldRaw($meta_key, false) → StringSanitizer → Separator
`
or simply:
`
GetFieldRaw($meta_key, false)
`

**Suggested fix** in addons/acf/classes/Export/FormatterFactory.php:

`php
// Add an explicit case before the default branch:
case FieldType::TYPE_WYSIWYG:
return FormatterCollection::from_formatter($formatter);
`

This mirrors how other explicitly handled types (date, image, link) use only $formatter (GetFieldRaw) rather than $formatters (the display pipeline).

**Affected file:** addons/acf/classes/Export/FormatterFactory.php
**Related file:** addons/acf/classes/ColumnFactory/Meta/FieldFactory.phpget_export() passes the display pipeline as $formatters, which the export factory should not use as a base for the default branch.

6 days, 20 hours ago
Stefan van den Dungen Gronovius
Developer

Thanks for your feedback. We changed the code so that the ACF WYSIWYG field now exports the raw value instead of the sanitized value. It will be shipped in the next update.

4 days, 10 hours ago