Discord Server Widget: How to Set It Up
In this article
Yes, you can set up a Discord server widget in a few minutes. The widget is a small, embeddable panel that shows your server's name, online member count, and an "Join Discord" button. It's useful for inviting visitors from a website or blog. You'll need to have "Allow Widget" enabled in your server settings first, then you can copy the widget code or use the widget URL. Here's exactly how to do it, step by step.
What You'll Need
- A Discord server where you have the Manage Server permission (required to change widget settings).
- Access to Discord on desktop (Windows/Mac) or the web app (browser). The steps are the same for both, but the exact menu labels may differ slightly by version and device.
- A website or platform that allows embedding HTML (like WordPress, Wix, or any custom HTML block). If you just want the invite link, you only need a browser.
Step-by-Step
- Open your server settings. In Discord, click your server name at the top-left of the screen. A drop-down menu appears. Select Server Settings (gear icon).
- Go to the Widget section. In the left sidebar of Server Settings, scroll down and click Widget. (If you don't see it, look for "Server Widget" or "Widget" under the "Community" or "Overview" sections, depending on your Discord version.)
- Enable the widget. Toggle the switch next to Enable Server Widget to the ON position. The toggle will turn green/blue.
- Choose the invite channel. Right below the toggle, you'll see a drop-down menu labeled Invite Channel. Select the text channel where new members will land when they click the "Join" button on the widget. This is usually your #welcome or #general channel, but any text channel works.
- Copy the widget URL. After enabling, Discord generates a unique URL that looks like:
https://discord.com/widget?id=123456789012345678. Click the Copy button next to it to copy it to your clipboard. This URL is the direct link to the widget if you want to use it as an iframe source. - Copy the HTML embed code (optional). If you want to embed the widget directly into a webpage, Discord provides a ready-made iframe code. Scroll down to the Widget HTML section (or click the "Copy" button under it). It looks like:
<iframe src="https://discord.com/widget?id=..." width="350" height="500" allowtransparency="true" frameborder="0" sandbox="allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts"></iframe>. Copy this entire code. - Paste the code into your website. Go to your website's HTML editor (e.g., a WordPress custom HTML block, a Wix embed element, or your site's source code). Paste the iframe code where you want the widget to appear. Save and publish.
- Test the widget. Open your website in a new tab and verify that the widget shows your server name, online count, and the join button. Click the join button to make sure it opens Discord and lets visitors join your server.
Common Mistakes
- Forgetting to enable the widget first. If you try to embed the widget URL before toggling "Enable Server Widget," the iframe will show an error or a blank box.
- Using the wrong channel. If you don't select an invite channel, the widget's join button won't work properly. Always pick a channel that is open to new members (not a private or locked channel).
- Pasting the widget URL instead of the HTML code. The URL alone won't render as a widget on a webpage; you need the iframe code. The URL is only useful for direct linking or for custom embeds.
- Copying the code before enabling the widget. The HTML code won't include the correct server ID if the widget isn't enabled. Always enable first, then copy.
- Not checking server privacy settings. If your server has "Community" settings or a verification level that requires phone verification, the widget's join button may not work for some users. Keep the server's verification level low (e.g., "Low") for the widget to be most effective.
Tips
- Customize the widget size. The default iframe is 350px wide and 500px tall. You can change the width and height attributes in the HTML code to fit your site's layout (e.g., width="300" height="400").
- Use the widget on your landing page. Place it near your call-to-action (like a "Join Our Community" button) to increase sign-ups.
- Combine with a custom invite link. The widget's join button uses the server's default invite link, but you can also create a custom invite link (with an expiration or max uses) and put it in your website's text. The widget will still use the channel you selected.
- Check the widget on mobile. The widget works on mobile browsers too, but it may be smaller. Test it on your phone to ensure it looks okay.
- Update the channel if your server structure changes. If you delete the selected invite channel, the widget will break. Always update the widget settings after changing channels.
Troubleshooting
If the widget doesn't appear or shows an error:
- Check the toggle. Go back to Server Settings > Widget and confirm "Enable Server Widget" is ON. If it's off, toggle it on and copy the code again.
- Verify the iframe code. Make sure you copied the entire code, not just the URL. The iframe code starts with
<iframeand ends with</iframe>. - Clear your browser cache. Sometimes your browser shows an old version of the page. Hard refresh (Ctrl+F5 on Windows, Cmd+Shift+R on Mac) or open in an incognito window.
- Check your website's embed restrictions. Some website builders (like certain Wix plans) block iframes. Look for an "HTML Embed" or "Custom Code" element and paste the code there. If that fails, use the direct URL as a link instead.
- Server ID issue. If you manually typed the code, double-check the
idparameter in the iframe URL. It should be your server's ID (a long number). To find it, enable Developer Mode in Discord (User Settings > Advanced > Developer Mode), then right-click your server icon and select "Copy Server ID." - Still broken? Try disabling and re-enabling the widget. Toggle it off, save, then toggle it back on and copy the new code.
Frequently Asked Questions
Can I use the widget on a non-Discord website?
Yes, the widget is just an iframe, so it works on any website that allows HTML embedding, including WordPress, Wix, Squarespace, and even plain HTML files.
Does the widget show the exact online count?
Yes, it shows the total number of members currently online (not in a voice call, just online). The count updates in real-time.
Can I change the widget's appearance (colors, text)?
No, Discord doesn't offer customization options for the widget's look. It uses Discord's standard dark theme. You can only change the size of the iframe.
Why does the widget show "0 Online" even though members are online?
This usually happens if the widget is cached or if your server has a large number of members but the widget's count is delayed. Refresh the page. If it persists, check that the server isn't set to "Private" (under Server Settings > Overview). Private servers may not display accurate counts.
Can I embed the widget on a Discord channel?
No, the widget is meant for external websites. Inside Discord, you can't embed it in a channel, but you can share the invite link directly.
Is the widget safe to use?
Yes, it's an official Discord feature. It only shows your server name, icon, online count, and a join button. It doesn't expose member usernames or any private information.