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
- Open your server and go to Server Settings > Widget. You need the Manage Server permission.
- Switch on Enable Server Widget.
- 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.
- 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:
| Endpoint | Gives you |
|---|---|
/api/guilds/ID/widget.json | Server 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.png | A 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.comtoframe-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.