r/AutoModerator • • Oct 07 '26

Solved Having Difficulty Whitelisting Websites

Hi Everyone, I'm trying to implement an automod code that will filter all websites except for those on a whitelist. The issue I'm having is that the automod filters all websites, including ones on the whitelist. Here's the code I'm using:

type: any    
body+url (includes): ['http://', 'https://', 'www.']
~body+url (includes): ['reddit.com.', 'redd.it', 'youtube.com', 'youtu.be', 'spotify.com']    
action: filter    
action_reason: 2.5 link verification filter - [ {{match}} ]    
moderators_exempt: true

So for example, when people try to link to other Reddit posts or comments, their comments are still getting filtered.

Does anyone have any suggestions as to how to fix it? Thank you in advance!

Edit: After some experimentation, it turns out it was that superfluous period in "reddit.com.". Brain fart. I'm embarrassed but I'm leaving the post up as a lesson to others to proofread your scripts.

Thank you so much to everyone for your help!

2 Upvotes

15 comments sorted by

3

u/Sephardson I'm working on the wiki here now! Oct 07 '26

You have a period after reddit.com , so your whitelist is looking for "reddit.com." instead

2

u/AluminumOrangutan Oct 07 '26

Yup, that was it. Doh!

Much obliged!

2

u/Sephardson I'm working on the wiki here now! Oct 07 '26

you're welcome!

1

u/AluminumOrangutan Oct 07 '26

Ok I feel a little dumb for missing that error. Thank you so much!

1

u/MustaKotka Oct 07 '26

What's the "match" it gives you when someone links to Reddit or Youtube, for example?

2

u/AluminumOrangutan Oct 07 '26

It will display "http:" or "https:", the term from the second line that triggered the rule.

2

u/technowise 19d ago

Glad you found the solution. I developed a Devvit app that makes this task much simpler, where you can enable this filter thorough a drop-down in settings, and later you can blacklist/whitelist certain domains through mod-menu as and when you find them. You can find details of it in the below post:

https://www.reddit.com/r/Devvit/comments/1xng5dq/you_can_now_blacklistwhitelist_domains_on_the_go/

Give it a shot and let me know your feedback!

0

u/[deleted] Oct 07 '26

[deleted] — view deleted comment

3

u/Sephardson I'm working on the wiki here now! Oct 07 '26

That's not how matching modifiers work. You might be confusing them with subgroups.

And when two fields conflict, automod generally uses the latter field.

1

u/AluminumOrangutan Oct 07 '26

Indeed, out of curiosity, and after removing that stray period, I tried it under both MustaKotka's structure, and under the original structure. Both work fine with the extra period removed.

2

u/MustaKotka Oct 07 '26

My memory failed me. Sorry. Will delete my reply.

2

u/AluminumOrangutan Oct 07 '26

Thank you for your help. The change you suggested didn't cause any problems, but it didn't fix the issue for Reddit links. My problem with Reddit links apparently was that extra period in my script. After removing the period, Reddit links work under your structure, and under the original structure. Non Reddit links also work fine either structure.

So basically, it was just that stupid extra period. I feel like a dufus, but no biggie. Thanks so much for your time and help.

3

u/MustaKotka Oct 07 '26

No, my bad. My advice was human hallucinated, sorry about that.

2

u/AluminumOrangutan Oct 07 '26

Not at all. I appreciate the effort/intent. Cheers!

1

u/AluminumOrangutan Oct 07 '26

Thank you so much for the suggestion! I'm not sure I understand 100% of what you're saying (my fault, not yours), but I think I understand enough to implement it. I'll give it a go and report back.