Discord API · error code

Discord error 50004: Guild widget disabled

ConfigurationPermissions and access

Last verified against Discord Developer Docs - Opcodes and status codes

What Discord returns
Guild widget disabled

What error 50004 means

You requested a guild's public widget data, usually GET /guilds/{guild.id}/widget.json or the widget image, and the server has its widget turned off. The widget is opt-in per server; when it is disabled, the public endpoints refuse to return anything.

Status pages, websites showing an "online members" count, and invite badges rely on these unauthenticated endpoints. They work for one server and fail for another purely because of this setting, which confuses developers testing against their own server first.

The setting lives in Server Settings > Widget in the client, or can be changed through PATCH /guilds/{guild.id}/widget by an account with Manage Server. Your code does not need a token to read the widget once it is enabled.

The authenticated GET /guilds/{guild.id}/widget settings route is separate: it tells a bot with Manage Server whether the widget is on, even while the public routes refuse.

What it looks like

{
  "message": "Guild widget disabled",
  "code": 50004
}

Why it happens

  • Server Widget setting is off for that guild
  • Widget was disabled by an admin after your site started using it
  • Wrong guild ID used for the widget URL
  • Using the public widget to read member counts that a bot could fetch with GET /guilds/{guild.id}?with_counts=true

How to fix Discord error 50004

  1. 1Ask a server admin to enable Server Widget in Server Settings
  2. 2Or, with Manage Server, call PATCH /guilds/{guild.id}/widget with enabled: true
  3. 3Confirm with GET /guilds/{guild.id}/widget (authenticated) that enabled is true
  4. 4Reload the public widget.json and confirm it returns data
  5. 5If you only need counts and your bot is in the server, use the guild endpoint with with_counts=true instead of the widget

How to stop it recurring

If your product shows widget data for many servers, detect 50004 and show a "widget disabled" state with instructions rather than a broken embed. Cache widget responses briefly; the public endpoints are meant for display, not frequent polling. Recheck occasionally, since admins can switch it off at any time.

Official reference: Discord Developer Docs - Opcodes and status codes. See all Discord error codes or the Discord limits and quotas.

Related codes

Error 50004 - quick answers

What does Discord error 50004 mean?

You requested a guild's public widget data, usually GET /guilds/{guild.id}/widget.json or the widget image, and the server has its widget turned off. The widget is opt-in per server; when it is disabled, the public endpoints refuse to return anything. Status pages, websites showing an "online members" count, and invite badges rely on these unauthenticated endpoints.

How do I fix Discord error 50004?

1. Ask a server admin to enable Server Widget in Server Settings 2. Or, with Manage Server, call PATCH /guilds/{guild.id}/widget with enabled: true 3. Confirm with GET /guilds/{guild.id}/widget (authenticated) that enabled is true 4. Reload the public widget.json and confirm it returns data 5. If you only need counts and your bot is in the server, use the guild endpoint with with_counts=true instead of the widget

Stop debugging Discord by hand

Connect the channel through Conferbot: tokens, webhooks and retries are handled, failures show as readable status.