How to embed a live Discord channel on your website

Updated

The short answer. Discord's own server widget is free and needs no bot, but it does not show any messages. It shows your server's name, how many members are online, up to 100 of them, your voice channels and, if you choose an invite channel, a "Join Discord" button. To show a channel's messages live on your site, and let visitors reply, you need a bot that relays the channel. Wizcord does this: add our bot to your server, pick a channel, and paste the code from your dashboard into your site.

Discord's server widget A live channel with Wizcord
Shows messages No Yes, live
Visitors can post No Yes: as a guest with a name, or signed in with Discord
Shows who is online Yes (up to 100) No
Needs a bot in your server No Yes
Set up in Your server's settings in Discord The Wizcord dashboard
Cost Free Free while Wizcord is in beta; paid plans are coming

Option 1: Discord's server widget

Use this if a "who is online, come and join us" box is all you need.

  1. In Discord, open your server's settings and go to Engagement. The widget is at the bottom of that page, under Server Widget. You need the Manage Server permission to change it.
  2. Turn on Enable Server Widget.
  3. Choose the channel the widget's invite should lead to. Without an invite channel, the widget has no "Join Discord" button.
  4. Copy the ready-made widget code that Discord shows there and paste it into your site's HTML.

What your visitors see: the server name, "N Members Online", your voice and stage channels that @everyone can see (with who is in them), a list of online members, and the Join button (if you set an invite channel). The widget has a dark look by default and a light one if the widget's address includes theme=light.

What it cannot do: show text channels or messages, or let anyone post. If it shows nothing or only a spinner, see our guide to fixing Discord's server widget.

Option 2: a live channel with Wizcord

With Wizcord, your visitors read the channel as it happens. New messages, edits and deletions appear without a reload. They can post in two ways:

  • As a guest, by choosing a name (2 to 32 characters). The message appears in Discord as "name (Guest)", posted through a webhook.
  • Signed in with Discord, under their own Discord name.

They can reply to messages. In Discord, a reply from your site starts with "↪️ Replying to name:" and up to 50 characters of the original message, because webhooks cannot send real Discord replies. Visitors can also react after signing in with Discord; in Discord, our bot adds the reaction in its own name. You can also choose to show pinned messages, public threads and forum posts, and a "Load older messages" button. Our examples page shows a screenshot of Wizcord in use on another website.

Before you start

  • You need the Manage Server permission on the Discord server.
  • Before you click Add to Discord, be signed in to Discord in your web browser, not only in the desktop app, because Discord asks you to confirm in a browser page. Finish the Discord step in the same browser, within 10 minutes of clicking Add to Discord.
  • Know where your website lets you paste HTML (a "Custom HTML" block, an "Embed" element or a code block, depending on your site builder).

Step 1: Create a Wizcord account

Create an account with your name, email address and a password (at least 8 characters). You are signed in straight away.

Step 2: Connect your server and add the bot

On your dashboard, click Add to Discord. Discord asks which server to add the Wizcord bot to. Pick yours and confirm. You come back to your dashboard with the server connected and the bot already in it, so you do not need to add the bot again.

The bot asks for four permissions:

  • View Channels, to see the channel and receive new messages.
  • Send Messages, so the bot can post in the channel itself.
  • Read Message History, to load earlier messages and pinned messages.
  • Manage Webhooks, to create one webhook per channel. Messages from your website are posted through it under the visitor's name.

Another way: click Connect Server and paste your server ID. To copy it, turn on Developer Mode in Discord (User Settings, then Advanced), right-click your server's icon and choose Copy Server ID. Then add the bot from the Embed your chat card: click Add the bot to your server.

Step 3: Check your setup

The Embed your chat card on your dashboard checks two things: that the bot is in your server, and that there is a channel it can read. When you pick a channel (step 4), the card says in plain words if the bot is missing a permission there, for example: "The bot cannot manage webhooks in this channel. Visitors will not be able to post." Fix it in Discord's channel settings and click Check again.

Under Channels your embeds may show you choose between every channel the bot can read and only the channels you pick, then click Save channels. Embeds follow the change within about a minute. Use the second choice if the bot can see channels you do not want on your website.

Step 4: Pick a channel and copy the code

  1. Pick the channel from the list. Age-restricted channels are listed but cannot be embedded. Forum channels appear in the list only when Show threads and forum posts is on.
  2. Choose how the chat appears:
    • Floating button (offered first). A chat button sits in a corner of the page and opens the chat in a panel. It fills the screen on phones.
    • Inline (iframe). The chat sits inside your page. Fits the page (the default) keeps it as wide as your page, up to a maximum you set. Fixed size uses an exact width and height.
  3. Set the options you want: pinned messages, older messages, threads and forum posts, dark or light, an accent colour. For an inline chat you can also show the channel list beside it (off by default). For the button you can set its corner, its label and whether it starts open.
  4. Check the live preview under the code. Then click Copy.

With no options changed, the floating button's code is one line:

<script src="https://wizcord.io/iframe/embed.js" data-channel-id="YOUR_CHANNEL_ID" async></script>

And the inline chat's code, as the dashboard writes it by default:

<iframe src="https://wizcord.io/iframe?channelId=YOUR_CHANNEL_ID&menu=false" width="100%" height="600" style="display:block;max-width:800px;max-height:80vh;border:0" frameborder="0" title="Discord chat"></iframe>

Every option is listed in our embed reference.

Step 5: Paste it into your site

Paste the code where your site builder accepts HTML. Put an inline chat where you want it to appear. The button's script can go anywhere on the page. If your site sends a Content-Security-Policy header, it must allow https://wizcord.io in frame-src, and in script-src for the button. Some hosted site plans do not allow custom code at all, so check yours first.

Step 6: Confirm it works

Open the page on your site and keep it open for a few seconds (with the floating button, open the chat once). The card's checklist then says We saw your embed on your site's address, with the time. For this, we keep a record of which channel's embed loaded, on which page address (never anything after a ? or #) and when. A record goes once it is 30 days old and another load is recorded, and in any case within 60 days. That record holds nothing about your visitors.

Keeping guest posts under control

The Guest posting card on your dashboard has three settings. They apply to every channel you embed from that server:

  • Allow guests to post (on by default). Turn it off and visitors must sign in with Discord to post.
  • Guest messages per minute, per visitor (0 to 120; 0, the default, means no limit). Visitors are told apart by their network address, so people sharing one connection may share one limit.
  • Blocked words (up to 200). A guest message or guest name containing one is refused.

Click Save. Changes reach your embed within about a minute.

Always on: guests can never ping anyone, and visitors signed in with Discord cannot ping @everyone or roles from your site.

What it does not do

So that you are not surprised:

  • Visitors cannot upload files or start a new forum post.
  • Private threads are never shown.
  • The floating button does not show a count of unread messages.
  • The chat's own text is in English.
  • Messages posted from your site are webhook posts, and Discord's AutoMod does not check webhook posts. Use the guest controls above.
  • There is no way to ban a single guest. You can delete a message in Discord, or turn guest posting off.

Which should you use?

If you only want to show that your server is active and invite people in, Discord's widget is enough, and it is free. If you want visitors to see the conversation and join in without leaving your site, or without a Discord account, use a live embed.

If you are choosing between live embeds, see Wizcord vs WidgetBot and WidgetBot alternatives. Building with React or Next.js? See Discord chat in React and Next.js.

Wizcord is free while it is in beta, and paid plans are coming. Create an account and follow the steps above.

Wizcord is free while it is in beta.

Create an accountRead the documentation