---
schema_version: "1"
id: 31ebc6ebf4ff5bea194286c289b351c8ef8ea280b53c55854d926797c98318d9
title: TreatAsContent()
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.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-content/mc-ampscript-reference-content-treat-as-content.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 2dd487ac863f580b287a0a1bf0cc5a80ec484d8192d7447a9b71abc7861598e5
products:
  - AMPscript for Marketing Cloud
  - Marketing Cloud
---
# TreatAsContent()

Treats a string as though it came in from a content area. To retrieve tracking information associated with these strings, include the [httpgetwrap string](/docs/marketing/marketing-cloud/guide/submitting_a_triggered_send_definition_with_tracking_via_httpgetwrap.html) in embedded links.

**warning:** Always sanitize user input within a `TreatAsContent()` 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

```
TreatAsContent(stringToReturn)
```

The `TreatAsContent()` function has one parameter:

- `stringToReturn` (string): Required. The string to return as content.

## Usage

This example returns a string of text. If the content contains personalization strings, the function replaces them with the appropriate data.

```
TreatAsContent(Field(@row,'Content'))
```

**important:** Use this function only with data that has been reviewed and optimized to appear as content.
