---
schema_version: "1"
id: 2b715f139e915484fe1fc5244bae39861fd1a9d2b0d946226a5095949f7725cf
title: TreatAsContentArea()
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/ampscript/references/content/mc-ampscript-reference-content-treat-as-content-area.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-content/mc-ampscript-reference-content-treat-as-content-area.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 3380956a5cd9b3b606919bbb8aebf273190ba5a64344a325b762d357e26c2b35
products:
  - AMPscript for Marketing Cloud
  - Marketing Cloud
---
# 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()](https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/fun_http/mc-ampscript-reference-http-get.md) or [Lookup()](https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/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')=%%
```
