---
schema_version: "1"
id: 2e084f834b8bcd2b23ed563fecf8919985cc855892587cfe49a0082e210523fb
title: WrapLongURL()
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/ampscript/references/fun_http/mc-ampscript-reference-http-wrap-long-url.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-http/mc-ampscript-reference-http-wrap-long-url.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 3f16784e77484b78ec1df501bccbb153e1343455b5e0e3cf78ccfb08d5d3b934
products:
  - AMPscript for Marketing Cloud
  - Marketing Cloud
---
# WrapLongURL()

Returns a shortened URL when provided with a URL that contains over 975 characters. Use this function to mitigate a known limitation with long URLs in Microsoft Outlook 2007–2013.

URLs that you shorten using this function are incompatible with Always On Clicks. If your Member DB is unavailable, the function returns an error.

## Availability

<table>
  <tr>
    <td>Marketing Cloud Engagement</td>
    <td>✅ Yes</td>
  </tr>
  <tr>
    <td>Marketing Cloud Next</td>
    <td>❌ No</td>
  </tr>
</table>

## Syntax

```
WrapLongURL(urlToShorten)
```

The `WrapLongURL()` function has one parameter:

- `urlToShorten` (string): Required. The URL to shorten.

## Usage

To use the function, pass it a URL to shorten. This example uses the resulting shortened URL in an HTML &lt;img&gt; tag.

```html
<!-- URL shortened for the purposes of illustration -->
<img
  src='%%=WrapLongURL("http://example.com/cb7de81e0b2845bd461c4543...8eef4715bbbe52c33831a02f/image.jpg")=%%'
/>
```

If the URL contains more than 975 characters, the function returns a shortened link that redirects through the Marketing Cloud Engagement servers. If the URL contains fewer than 975 characters, the function returns the URL unchanged.
