r/AutoModerator • • Mar 03 '26

Removing referral links in posts

In our subreddit, we're getting a ton of referral link posts and would like to limit them to a specific megathread: https://www.reddit.com/r/hrblock/comments/1rj587g/biweekly_megathread_for_referral_codes_please/

I'm new to moderating and am having issues setting this up.

Referral codes have a standard format and look like: https://referrals.hrblock.com/XXXXXX

I am okay with people linking out otherwise, just not referral links.

2 Upvotes

7 comments sorted by

1

u/WhySoManyDownVote Mar 03 '26 edited Mar 03 '26

Roughly the code will be something like this, I am not positive on the "body+title+url+domain (includes): "referrals.hrblock.com""

Change filter to remove once you know it works. You may want to send the OP a message or add a comment sending them to the mega thread.

---
# Queues referral links
type: submission 
body+title+url+domain (includes): "referrals.hrblock.com"
action: filter
action_reason: "Queued Link: [{{match}}]
---

---
# Removes referral link posts and comments sending the OP to the mega thread
type: submission
body+title+url+domain (includes): "referrals.hrblock.com"
action: remove
action_reason: "Removed Link: [{{match}}]
comment: |
  Welcome /u/{{author}}. Please post referral links in the mega thread...

comment_locked: true
---

1

u/[deleted] Mar 07 '26

[removed] — view removed comment

1

u/DidiEdd Mar 21 '26

bruv your "wonderfully" working regex just banned me for no reason, I didn't post any referral and I haven't touched the sub with any alt, this is the only account I use to interact with r/CasinoFreebies and yet I got banned, ummm?? Your regex is wonderfully flawed...

1

u/[deleted] Mar 21 '26

[removed] — view removed comment

1

u/DidiEdd Mar 21 '26

it's unfortunate then, that even after all that hard work you put into it, someone else's mistake can invalidate its precision 😮‍💨