Skip to content

How to add a Discord widget to your website

The official iframe in two minutes, or a custom widget from Discord's JSON and image endpoints.

Updated November 19, 2026

Discord gives every server a free widget you can put on any web page. It shows that the server is alive: an online count, some members, open voice channels and a button to join. There are three ways to use it, from a copy-paste iframe to your own design.

1. Turn the widget on

  1. Open your server and go to Server Settings > Widget. You need the Manage Server permission.
  2. Switch on Enable Server Widget.
  3. Pick an Invite Channel. The widget creates invites to this channel for its join button. With no channel set, the widget has no join button.
  4. Copy the Server ID shown on the same page, or copy the premade widget code.

2. Paste the iframe

The premade widget is an iframe. It looks like this, with your server ID in place of the zeros. Copy the exact code from your Widget settings rather than this example:

<iframe
  src="https://discord.com/widget?id=000000000000000000&theme=dark"
  width="350" height="500"
  allowtransparency="true" frameborder="0"
  sandbox="allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts">
</iframe>

Paste it into an HTML block in your site builder (WordPress, Wix, Squarespace and the rest all have one). The iframe's look is controlled by Discord. You can change the size and the light or dark theme, but not the colours or layout inside it.

3. Build a custom widget

If the iframe does not fit your design, Discord exposes the same data two other ways once the widget is on:

EndpointGives you
/api/guilds/ID/widget.jsonServer name, the widget invite, voice and stage channels open to everyone, up to 100 online members with status, and the online count
/api/guilds/ID/widget.pngA ready-made image. ?style= takes shield (default), banner1, banner2, banner3 or banner4

A minimal custom widget reads the JSON and shows the count and join link:

const res = await fetch("https://discord.com/api/guilds/000000000000000000/widget.json")
const w = await res.json()
el.innerHTML = `<b>${w.presence_count}</b>{" "}online in ${w.name}
  <a href="${w.instant_invite}">Join</a>`

Member data in the widget is deliberately limited: Discord anonymises member IDs and avatars, so you get display names and status, not accounts you can look up. Use the image endpoint if you only need a badge for a README or a forum signature.

When the widget will not show

  • Widget off. The iframe spins or shows an error until Enable Server Widget is on.
  • Wrong ID. Copy it again from the Widget page; a user ID or channel ID will not work.
  • Blocked frame. If your site sends a Content Security Policy, add https://discord.com to frame-src.
  • Ad blockers. Some block third-party iframes. Test in a private window.
  • No join button. Set an Invite Channel.

Widget or join button?

A widget is nice on a community page. On most pages a single Join our Discord button does more, because it is one click and loads instantly. Make the link from an invite with Expire After set to Never and no use limit, so it does not die after 7 days. Never is only offered in Community servers.

After they click join

The widget and button bring people in. VaultCord handles the next step. Set the widget's Invite Channel to your verify channel, or link your site's button straight to your verify page, so new members pass a captcha on a branded page before they can talk. Members who verify can be pulled into a new server if yours is ever deleted, at one member every 0.98 seconds, on every plan. The Free plan covers 1 server. Set it up, then make your links look right with the embed preview guide or add Login with Discord.

Questions

What is a Discord widget?

A small box Discord renders for your server on any website: server name, how many members are online, some of them by name, voice channels open to everyone and a join button.

How do I make a custom Discord widget?

Turn the widget on, then read your server's widget.json endpoint and draw it in your own HTML and CSS. For a static image, use widget.png with a style such as banner2.

Why is my Discord widget not showing?

Usually the widget is off in Server Settings > Widget, the server ID in the code is wrong, or your site's Content Security Policy blocks frames from discord.com.

Can I embed Discord chat on my website?

Not with Discord's own widget. It never shows messages. Chat embeds come from third-party bots, so check what permissions they ask for before adding one.

Why is there no Join button on my widget?

The widget has no invite channel set. Pick one under Invite Channel in Server Settings > Widget and the widget creates an invite to it.