# TreatAsContentArea()

Treats content retrieved from a data extension or other source as though it’s fixed content coming from a content area.

:::warning
Always sanitize user input within a `TreatAsContentArea()` block. Remove, escape, or disallow input that contains HTML tags or AMPscript code, or use an allowlist of safe characters.
:::

## Availability

<table>
  <tr>
    <td>Marketing Cloud Engagement</td>
    <td>✅ Yes</td>
  </tr>
  <tr>
    <td>Marketing Cloud Next</td>
    <td>❌ No</td>
  </tr>
</table>

## Syntax

```
TreatAsContentArea(contentKey, contentValue, impressionRegion)
```

The `TreatAsContentArea()` function has three parameters:

- `contentKey` (string): Required. The key value that’s used to identify the content specified in the second string. The function treats a key in a text context as distinct from a key in an HTML context. Use the same key to identify distinct text and HTML versions of the content. The function processes all keys in a case-insensitive manner.
- `contentValue` (string): Required. Content stored for an email send under the key specified in the first string. To retrieve the content, use the [HttpGet()](/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-http/mc-ampscript-reference-http-get.md) or [Lookup()](/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-data-extension/mc-ampscript-reference-data-extension-lookup.md) functions.
- `impressionRegion` (string): The name of the impression region for the virtual content area.

:::note
The maximum number of virtual content blocks is 300.
:::

## Usage

This example pulls content from a data extension and saves it for reuse as a virtual content area under the key VirtualCA1.

```
%%=TreatAsContentArea('VirtualCA1', Lookup('DEName', 'DEContentColumn','KeyField', KeyValue))=%%
```

This example pulls content from a data extension and saves it for reuse as a virtual content area under a key specified through the KeyValue attribute or data extension field.

```
%%=TreatAsContentArea(KeyValue, Lookup('DEName', 'DEContentColumn','KeyField', KeyValue))=%%
```

This example pulls content from a data extension, saves it for reuse as a virtual content area under the key VirtualCA1, and assigns it the impression region name of Impression Region One.

```
%%=TreatAsContentArea('VirtualCA1', Lookup('DEName', 'DEContentColumn','KeyField', KeyValue), 'Impression Region One')=%%
```
