How to block Discord links while still allowing GIFs
A link filter can remove ordinary web links without forcing members to give up the GIFs they share in chat. This setup uses the Build Discord Bots AutoMod Link Filter in whitelist mode: unapproved links are deleted, while Allow GIFs lets through a message whose links are all from its supported GIF sources. AutoMod is a Pro module. The exception is deliberately narrow, so this guide identifies the accepted hosts, the people it skips, and a controlled test before you rely on it in a busy channel.
Start freeStart free. Pro is $9.99/month.
Before you start
- Use an online Build Discord Bots bot in a Discord server you manage, with Pro. AutoMod is a Pro module. Have a private staff log channel ready if you want to review removed links.
- Use a second ordinary Discord account to test. AutoMod skips bots and everyone with Manage Messages, including the server owner and most staff roles, so an owner test is not a valid filter test.
- Choose one harmless approved domain for your server, such as your own site, and one harmless ordinary domain that is not on that list. Have a supported GIF URL ready as well. Do not test with customer, staff, or sensitive links.
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.
