Skip to main content
A link preview or embed is what shows up in Discord when a link to your website is pasted into a chat. If you’ve ever seen an embed pop up with a description, images, or a video, that is a link preview. Discord builds that card automatically by fetching the page and reading the metadata in its HTML. The process of building that embed is called unfurling. This page covers the standard unfurling process with a title, description, and image or video. If you want more control over your preview, Component Embeds let you build a fully custom layout out of select Discord components.
Link previews are subject to change.

Quick Start

Drop this into the <head> of a page, and you get a preview with your site name, a linked title, a description, an accent color, and a large image below the text.
An embed link preview showing the example above

How Discord Reads Your Page

Discord makes a single GET request for the URL that was shared and parses the HTML that comes back. Your page has to meet all of the following for a preview to appear:
  • An HTML page served over HTTP or HTTPS.
  • The tags must be in the HTML your server sends. No code is executed, so tags added by a client-side script after load are never seen.
  • The response must be a 2xx.
  • Content type of text/html or application/xhtml+xml, and not served as a download with Content-Disposition: attachment.
  • At most 5 redirects.
  • At most 50 MB of data returned.
  • The whole fetch, including measuring your images and video, must finish within 10 seconds.

Tag Reference

For each tag:
  • The key comes from name if present, otherwise from property.
  • The value comes from content if present, otherwise from value.
  • Key names are case-sensitive.
  • When several tags map to the same field, the first non-empty one wins for the title, description, and site name. For layout, color, and date tags, the last one in the document wins.

Preview Layouts

The tags you set decide which embed layout is chosen.
Title, description, and one image, with no layout tags example

When setting title, description, and one image, with no layout tags you'll see text with a small image.

`twitter:card` set to `summary_large_image` example

When twitter:card is set to summary_large_image you'll see text with a large image below it.

`twitter:card` set to `photo`, or the shared URL points straight at an image file example

When twitter:card is set to photo, or the shared URL points straight at an image file, you'll see the image on its own, with no description.

`og:type` set to `video.other` or `twitter:card` set to `player`, plus a video file example

When `og:type` is set to `video.other` or `twitter:card` is set to `player`, plus a video file, you'll see an inline video player using `og:image` as the preview frame, with no description.

Two or more `og:image` tags example

When there are two or more og:image tags you'll see a gallery of up to 4 images.

`og:type` set to `rich` example

When og:type is set to rich you'll see Discord rendered markdown text with a small thumbnail.


Images

  • Supported formats are .png, .gif, .jpg, .jpeg, .webp, and .avif.
  • Provide og:image:width and og:image:height. Without them, Discord fetches the image to measure it.
  • Relative URLs must start with /.
  • Dimension, type, and alt tags attach to og:image and twitter:image only. They are not read for og:image:url, og:image:secure_url, or twitter:image:src, so use the plain tag names when you want to declare dimensions.
  • Two or more og:image tags produce a gallery. At most 4 images are shown.
  • Sharing a URL that points straight at an image file produces an image preview with no metadata required.
To display up to 10 images, use Component Embeds.

Video

  • Supported formats are .mp4, .webm, and .mov.
  • Point the og:video tag directly at the video file.
  • Set og:type to video or video.*. Or set twitter:card to player.
  • og:image is required to render the video and it becomes the preview frame.
  • Serve the file over https.
  • Discord measures the file to size the player, so og:video:width and og:video:height are optional. If the file cannot be measured and no dimensions are declared, the video is dropped and the layout falls back to a plain link preview.

oEmbed

Discord supports oEmbed in JSON only, discovered through a link tag in your document:
oEmbed runs after Open Graph, so most of its fields fill gaps rather than replacing what your <meta> tags already said. These fields are used: html, url, width, height, and cache_age are ignored. Errors fetching or parsing the oEmbed document are ignored too.

Accent Color and Publish Date

theme-color sets the accent color of the preview, and it has to be a 6 or 8 digit hex value:
Publish dates have to be full RFC 3339 timestamps with a time and an offset:

Limits

The description is shown as plain text, and HTML tags in it appear literally. On og:type rich previews, the description is rendered as Discord markdown instead.

Caching and Testing

Discord caches previews for about 30 minutes. While a preview is cached, editing your tags and resharing the same URL shows the old card. To see changes immediately, share the URL with a new query string, such as ?v=2. You can also use the Embed Debugger which shows how Discord reads a URL, including which tags it picked up and which layout it chose.

Next Steps

Component Embeds

Build a fully custom preview layout for your links out of Discord components.