How to block Discord links while still allowing GIFs
Discord invite links and ordinary web links use two different Build Discord Bots filters. The Free Moderation module has an invite-only dashboard setting for Discord invite links. Its separate Pro AutoMod Link Filter can remove ordinary web links while Allow GIFs keeps a message whose links are all from its supported GIF sources. Choose the narrower Free invite route when outside-server invites are the problem; do not call it an ordinary-link filter or use AutoMod’s Pro denylink command for it.
Start freeStart free. Pro is $9.99/month.
Before you start
- For the Free invite route, use an online bot in a server you manage with Moderation enabled. For the broader ordinary-link and GIF route later in this guide, AutoMod requires Pro. Have a private staff log channel ready if you want to review enforcement.
- Use a second ordinary Discord account to test. The Free invite filter skips the server owner, members with Administrator or Manage Messages, and exempt roles. AutoMod also skips bots and everyone with Manage Messages, so an owner test is not a valid filter test.
- Use a private test channel and a consenting test member. For the Pro Link Filter steps, choose one harmless approved domain, one harmless ordinary domain that is not approved, and a supported GIF URL. Do not test with customer, staff, or sensitive links.
Choose the Free invite-only filter for Discord invite links
If your goal is to stop members posting Discord server invites, open your bot’s Modules tab, enable Free Moderation, then open its Settings and select the server. Turn on Block Discord invite links. This opt-in dashboard setting starts off. It is not a Discord command: configure this path in Moderation Settings, not with the Pro AutoMod `denylink` command.
The Free filter recognizes Discord invite links on discord.gg, discord.com/invite, discordapp.com/invite, and dsc.gg, including the normal http, https, www, or angle-bracket forms. It is an invite-only filter, so it does not block ordinary website links. The server’s own vanity invite is left alone; use an outside-style test string in a private test channel instead of treating your own server invite as a failed test.
Set invite exceptions and an action deliberately
With Block Discord invite links enabled, Channels where invites are allowed accepts comma-separated channel IDs; a thread follows its parent channel’s allowance. Exempt role IDs accepts comma-separated role IDs. The filter also skips the server owner and members with Administrator or Manage Messages. Keep the initial exception lists empty unless a specific announcement or partnership channel needs to allow invites.
Choose Delete the message, Delete and warn (counts toward auto-punish), or Delete and time out. The timeout field appears only for Delete and time out and accepts 1 through 40,320 minutes, which is 28 days. Tell the member why posts a channel notice that disappears after 10 seconds; it is not a DM. If a moderation log channel is selected, the filter writes its enforcement entry there. Save Settings after each deliberate change.
Test the Free invite filter with a consenting member
From the ordinary test account in the private test channel, send a harmless outside-style string such as discord.gg/testinvite. With the default Delete the message action, it should be removed. Check the selected moderation log channel if you configured one. Do not test from the server owner or an account with Administrator or Manage Messages, because the filter intentionally skips those accounts.
Next, add the test channel ID to Channels where invites are allowed, save, and repeat the same test. The message should remain; remove the temporary allowance and save again when you finish. If you need a warning or timeout policy, test it only with a consenting member after reviewing the action and the configured duration. The filter is opt-in and does not scan messages that were posted before you enabled it.
Enable AutoMod and open Link Filter settings
In the dashboard, open your bot, choose Modules, turn on Auto Moderation, then open its Settings from the card gear button. Select the Discord server you are configuring. Settings are per server, so check the server selector before you change a filter or save it.
Under Link Filter, turn its Enabled toggle on and choose Delete Message as the action. This filter works on web addresses that start with http or https; it deletes a message only when its mode and domain lists say the link should be filtered. The setting does not merely turn off Discord link previews.
Use a nonempty whitelist for ordinary links
Set Link Mode to Whitelist, then add the harmless domain you chose to Allowed Domains (Whitelist). A whitelist permits that domain and its subdomains. In this mode, an ordinary http or https link to a domain that is not on the nonempty list triggers Link Filter and receives the Delete Message action.
Do not leave Allowed Domains empty when you expect whitelist mode to block links. An empty whitelist has no domain to compare, so Link Filter does not remove ordinary links in that mode. Blacklist mode is different: it removes only domains you add to Blocked Domains (Blacklist), not every other link.
Turn on Allow GIFs and save
Turn on Allow GIFs in the same Link Filter card, then click Save Settings and wait for Saved ✓. This exception is checked before the whitelist or blacklist decision: a message remains only when every web link in it is a supported GIF URL. Other links still follow the Link Mode and action you selected.
New Link Filter configurations start with Allow GIFs on. A saved Link Filter created before this setting existed behaves as off until you turn it on and save, so it continues filtering GIF links according to its prior link rules. If your bot was generated before the feature was added, regenerate it before testing so its running module includes the setting.
Know exactly which GIF links count
Allow GIFs accepts links on these GIF hosts: tenor.com, giphy.com, media.tenor.com, and media.giphy.com. It also accepts links on cdn.discordapp.com and media.discordapp.net only when the URL path ends in .gif. These are the exact hosts the module checks; a different GIF provider is not included by this setting.
A message with one supported GIF link stays. A message with a supported GIF and an ordinary link does not receive the exception, because every link in the message must be supported. Likewise, a non-Discord site whose URL happens to end in .gif is not accepted by the exception. Keep tests to the listed sources rather than assuming that every animated image or provider is covered.
Test a GIF, an unapproved link, and an approved link
From the ordinary test account, send one supported Tenor, Giphy, or qualifying Discord CDN GIF URL in a test channel. It should remain. Then send the harmless ordinary URL that is not on Allowed Domains (Whitelist). It should be deleted because whitelist mode has a nonempty list and that domain is not approved. Finally, send the approved domain and confirm it remains.
Try one message that contains both the supported GIF and the unapproved ordinary URL. The message should be deleted: Allow GIFs applies only when all links are supported GIF sources. If you selected an AutoMod Log Channel, review the staff-only log after the deletion. Remove the test URL from chat or use a disposable test channel when you are done.
Check exemptions and the usual failures
Each AutoMod filter has its own Exempt Roles and Exempt Channels. A role or channel listed in Link Filter’s exemptions bypasses Link Filter only; it does not exempt that message from the other AutoMod filters. Separately, every member with Manage Messages is skipped by AutoMod enforcement, regardless of the Link Filter exemption lists. Review both places before concluding a test failed.
If a supported GIF is deleted, confirm that Allow GIFs is on, the message contains no other links, and its URL uses one of the exact supported hosts. If an ordinary link stays, confirm Link Filter is enabled, whitelist mode has at least one allowed domain, the test account lacks Manage Messages, and the test channel and role are not exempt. Save after every correction, and retest with a new message: AutoMod does not revisit messages sent before the setting changed.
Frequently asked questions
Which GIF links does AutoMod Allow GIFs accept?
It accepts tenor.com, giphy.com, media.tenor.com, and media.giphy.com links. It also accepts cdn.discordapp.com and media.discordapp.net links only when their URL path ends in .gif. Other GIF providers and ordinary sites ending in .gif are not part of this exception.
What happens when a Discord message has a GIF and another link?
The GIF exception does not apply. Every web link in the message must be a supported GIF source, so the message follows the Link Filter mode and action you configured. In whitelist mode with a nonempty approved-domain list, an unapproved ordinary link makes the message eligible for deletion.
Why does the link filter not remove my test link?
Test from an account without Manage Messages, then check that Link Filter is enabled and that its Link Filter Exempt Roles and Exempt Channels do not cover the test. In whitelist mode, also add at least one Allowed Domains entry; an empty list does not block ordinary links.
Why are GIF links still being deleted after this feature was added?
A saved Link Filter without the Allow GIFs setting predates it and behaves as off until you turn the setting on and save. Also confirm the bot was regenerated if it was generated before the feature was added, and check that the message contains only supported GIF URLs.
