/r/AutoModerator

Photograph via snooOG

Important announcements, helpful tips, and discussion regarding AutoModerator.

What is AutoModerator?

AutoModerator is a highly customizable moderation bot. It monitors new and edited submissions and comments in your subreddit and acts on them as needed.

What can AutoModerator do?

AutoModerator is commonly used to:

  • Enforce title formatting and other subreddit-specific posting rules
  • Detect and flag offensive, inappropriate, or rule-breaking content based on keywords/phrases
  • Automatically remove posts from specific users and/or websites from your subreddit
  • Post regular community discussion threads
  • Alert subreddit moderators if certain types of content are posted
  • And much more!

PLEASE READ

AutoModerator does not remove or report content by moderators by default, so test your conditions with a non-moderator account or add "moderators_exempt: false"

Get Started

/r/AutoModerator

16,640 Subscribers

2

Only Allow Crossposts

Hi. Thanks in advance for whatever help you are kind enough to provide. I made an effort to answer these questions on my own (google, this sub, full documentation).

On r/TitlePorn (which isn't porn actually, it's a sub for crossposts with puns in the title), I got a recent karma farming post that wasn't caught by automoderator so I'm thinking I need to improve my automod code.

  1. Removing any post that isn't a crosspost: I saw in the full documentation the top level type "corsspost submission". Does automod action based on type exclusion?


    type: ~crosspost submission

    action: remove

    action_reason: not a crosspost


If not, is there a different way to only allow crossposts?

While I was in the full documentation, I noticed some other useful code (repost, crosspost_title, and is_nsfw):

  1. Removing duplicates: would this sucessfully remove duplicate posts?


    type: submission

    title: "repost"

    action: remove

    action_reason: "possible repost"


  2. Preventing OP from rewording a title of a crosspost: can automod use crosspost_title and {{match}} to remove a post if the title of a crosspost does not match the title of the original post? How would I correctly format that rule?

  3. Removing crossposts from nsfw subs: How would I format a rule correctly to remove any crosspost that is from a nsfw sub using "is_nsfw"?

2 Comments
2024/04/06
14:15 UTC

1

Hello I would like automod to comment on every post being posted in my sub. Any help?

I would like the automod to comment in every post and always appear on the top. What I like to be commented is : PRODUCT LINK SHOULD BE COMMENTED HERE.

is there is also a chance that I could name the automod what I want?

2 Comments
2024/04/06
00:22 UTC

0

Auto mod comments on new posts?

Is there a way to get auto mod to register key words like “selling” or “10k” or something similar, and make a pinned comment or just a normal comment on the post to say “hey, use mod mail for big purchases to avoid scams”?

3 Comments
2024/04/05
22:55 UTC

1

How do I assign a User Flair to all my Members?

To celebrate my sub r/500kgofDemocracy reaching 500 members, my community suggested giving each member a special flair to commemorate the event. I would hence like to use AutoMod, if possible, to assign the flair in question to all the 500 members that would've joined up until then.

Two important things:

  1. A dozen of my members already have a user flair and if possible I would like for them to keep it in addition to the commemorative flair.

  2. Will the users be able to remove the flair if they so wish after it getting assigned automatically by AutoMod?

Thanks in advance for the help!

9 Comments
2024/04/05
06:52 UTC

2

Two rules, one functions and one doesn't, even though the first one precedes the second.

This is the first block, which doesn't seem to do anything. I much prefer it because it's a more specific answer. Is it maybe because type submission is in the wrong order? Many thanks to anyone who can break it down for me.

---

# [23] Salary

type: submission

title (includes): ["Salary", "salary", "Expectations", "expectations", "Salaries", "salaries"]

action: remove

action_reason: Salary Question

comment: Your post has been removed. Ask it in the Megathread. [Click here](https://www.reddit.com/r/Luxembourg/search/?q=megathread&type=link&cId=cf7f9fa1-e1e0-402e-b62e-27511772037e&iId=0619a8cc-16db-403d-9c51-9022d506d481) https://www.reddit.com/r/Luxembourg/search/?q=salary&restrict_sr=1&sr_nsfw= and https://www.luxtimes.lu/expathub/moneyandwork/work/looking-for-a-new-job/1328912.html

This is the second block, which does work.

---

# [25] question touristique ?

title+body (includes): ["cost of living", "salary", "hostel", "hotel", "honeymoon", "travel", "visiting", "visit", "layover", "tourist", "traveling", "propose", "Work with laptop", "work with laptop", "proposal", "apartment", "apartament", "layover", "flight to", "visiting", "tourism", "birthday", "first time", "visiting", "tourists", "1 month", "2 months", "3 months", "4 months", "one month", "two months", "3 months", "4 months", "1 week", "a few days", "2 weeks", "3 weeks", "one week", "two weeks", "three weeks", "arriving", "I am coming", "coming", "wifi", "ISP", "service provider","Does anyone", "New Years Eve", "NYE", "New Year's Eve", "trip", "TRIP", "fiancé", "safe", "neighborhood", "neighbourhood", "third", "job", "jobs"]

type: submission

moderators_exempt: false

action: filter

action_reason: "Automod 1: question touristique ?"

comment: We have a weekly [megathread](https://www.reddit.com/r/Luxembourg/search/?q=megathread&restrict_sr=1&t=month) for common questions. Please use it. Just change the sort from Relevance to New to find the latest one. Please also use the search bar. Just add your search term after r/luxembourg

7 Comments
2024/04/04
10:25 UTC

4

How to enable img/gifs only in a specific post (by its title or flair)?

We want to enable images/gifs in comments on our sub, but only in one post, which has a specific title and type of flair. How can we do that?

What we've been trying to do is enabling imgs/gifs in mod tools, then not allowing imgs/gifs in the entire sub via automod and now we're looking for a code that would exempt this specific post from not allowing imgs/gifs. Is it possible? Or do you know any other way?

4 Comments
2024/04/03
20:15 UTC

3

If title has one word, it requires another

I have this right now...

---
moderators_exempt: false type: submission ~title (includes, regex, case-sensitive): ['WHAT', 'HOW', 'XXIX', 'Place', 'Brainfugd', 'Dim', 'Chaoz Fantasy', '(?i:platonic)', '(?i:cellular)', '(?i:eon)', '(?i:revenge)',] action: remove comment: | Your post was removed because the title didn't contain the name of any of the required words!
---

I'm wondering if theres a way that instead of making it so that instead of one of the required words being "Chaoz Fantasy", I could make it that it can include both "Chaoz" and "Fantasy", but not just one of the two words.

For example, if the title said "My Chaoz is Fantasy", it would not get removed, and it wouldnt get removed for "My Fantasy is Chaoz" or just "My Chaoz Fantasy" either. But, if someone titled it "I have a Fantasy" or "I have a Chaoz" it would get removed.

(Keep in mind I do still want it to be optional, there's a list of words subreddit members can choose from. So for example if someone said "WHAT is my Fantasy" that wouldnt get removed, or jsut "WHAT the hell" wouldnt get removed either, since WHAT is also a required word)

2 Comments
2024/04/03
13:53 UTC

3

Question about AutoMod commands and flairs

Hi there,

On the subreddit I moderate people with a flair are able to summon AutoMod to give pre-made responses (for example !duck which would give information about ducks.

On this moment I've added the flairs to the code, but is there a way that if a user is either a moderator or approved user they can trigger the commands too; even without a flair being listed under the command in the code.

6 Comments
2024/04/03
07:21 UTC

3

Does automod comment on moderator posts?

---
type: submission
comment: |
    If this post fits the purpose of r/StardewValleyInspo, then **bold** upvote this post.**bold** If this post is irrelevant to the purpose of r/StardewValleyInspo or contains inappropriate language, **bold**downvote and report this post.**bold**
comment_stickied: true
---

Above is my first rule for my automod. I'm in desperate search of answers so heres a list of my questions (:

  1. Did I use the **bold** element correctly?
  2. How long does it take for Automod to comment on posts?
  3. Does automod comment on mod posts or do I need to create an alt to test?
11 Comments
2024/04/03
03:28 UTC

1

Is my image filtering code correct? One post sneaked through

Two main questions.

  1. Primary concern, even though this has been catching posts, we had one sneak through. It had multiple images in the post, should that matter?
  2. The automod reports are going to the "Unmoderated" section of the queue, and not directly into the "mod queue". Mod mail is being sent though, just want to help the mod time find these easier since probably 60-70% are usually clear for approval.

I found the code here from a previous post when searching how to filter these. I'm not sure if it's filtering both on "Image & Video" posts with images, and also on text posts with images added in.

---
# Image Posts Filtering: Filter posts that include an image
type: submission
moderators_exempt: false
body+title+url (regex, includes): ['\.(gifv?|jpe?g|png)\b', 'gallery', 'image']
action: filter
action_reason: "Thank you for your image post, the moderator team will review shortly: [{{match}}]"
modmail: The above item posted by /u/{{author}} has been filtered for image approval per sub rules.
---

1 Comment
2024/04/02
17:42 UTC

3

Having trouble trying to block unapproved domains from text submissions.

So I've been having a lot of issues with bots / spammers posting links to their random blog articles, etc. I decided to outright block any domains that aren't explicitly whitelisted, as my sub doesn't really see a wide variety of legitimate links anyway.

Here's the basic code I'm using for that --

~domain: [approveddomain.com, approveddomain2.com]
author:
  is_contributor: false
action: remove

..

type: comment
url+body (regex): ['https?://(?!\S*(approveddomain\.com|approveddomain2\.com))[\w\.\-]+']
author:
  is_contributor: false
action: remove

This is just code I found elsewhere and pieced together. The top code worked for link submissions, but was still allowing links in comments, so I added the second bit of code which is working just fine.

But now I've started seeing an influx of text submissions with links and they're avoiding the automod rules. I thought I could solve that using the same code I use for comments:

type: text submission
url+body (regex): ['https?://(?!\S*(approveddomain\.com|approveddomain2\.com))[\w\.\-]+']
author:
  is_contributor: false
action: remove

But it isn't working as expected and is still allowing links to any domain to be embedded in text submissions.

Any idea what I'm doing wrong?

1 Comment
2024/04/02
15:33 UTC

2

Can automod make a comment on a comment or post after being reported under a certain subreddit rule?

I'd like for automod to be able to make a comment on posts/comments that get reported for a specific subreddit rule. It doesn't have to remove the parent comment, but simply post a message to serve as a reminder of the subreddit rule.

Trying to do this by removing the comments and using reddit's removal reasons and reapproving the comment is tedious. Having an automod rule would help immensely, but I don't know how to write it or if it's even possible. I'd appreciate any help!

3 Comments
2024/04/02
15:04 UTC

0

Can automod remove posts that reuse old links? Asking because of spam bots.

I've seen some spam bots that reuse old links for karma. Is there an automod script that can block them and stop them from reusing?

1 Comment
2024/04/02
10:34 UTC

2

Spam accounts getting around by crossposting from their own account

So there are these accounts over 10 days with positive Karma that I'm guessing are hacked. They cross post from their own account. So the link is to the URL Reddit.com and comes from u/#user name here. Is there a way to stop posts from these accounts while still allowing people to crosspost?

14 Comments
2024/04/02
07:33 UTC

2

Can you use automod to trigger crowd control

Looking for a solution to use automod to trigger crowd control.

I guess I probably could have hacked together a solution using combined_subreddit_karma, but that feels like reinventing the wheel and not as elegant...

Is this possible? If not, I like this feature would be really helpful for subs to manage influx on specific topics.

10 Comments
2024/04/01
17:58 UTC

0

Automoderator to verify posters and reduce spam

Here's an updated take on my automod rules for self-verification of posts - this approach has tremendously cut down on reposting karma farm bots and t-shirt spam.

Prework -

  • Enable "User Flair" for your subreddit
    • Visit https://www.reddit.com/r/subreddit/about/userflair -> Click "Settings" and "Enable User Flair" - optionally enable "Let users assign their own user flair"
    • Create at least one mod only "user flair' - this is what the automoderator will set for users once they follow the approval process for their first post. (ex: New Poster)
      • Optionally create a second-level mod only flair (ex: Contributor)
    • Click the "Copy ID" button and paste the flair ID to a notepad for safekeeping (You will be using this in the automod config later) - keep track of each mod-only flair and corresponding ID
  • Set your subreddit spam filter strength to "All" for both Posts and Links - this will force every single submission to be filtered - we then rely on the automoderator to approve posts if users follow instructions.
    • Visit https://www.reddit.com/r/subreddit/about/edit?page=posts and then find the "Spam filter strength" section.

  • Part 1: Approve submissions with assigned user flair - this means they've either set their own flair or previously completed the automod verification.

---
# Auto-approve any submission that has any user flair set 
type: submission
author:
    flair_text (regex): ['.+']  # user flair is set to any value  
action: approve
action_reason: 'Post Approved - user flair set.'

  • Part 2: Non-verified user posts, the automoderator replies to their post and sends them a message with instructions on next steps.

---
# Applies to any new post that doesn't have user flair set
type: submission
author:
    ~flair_text (regex): ['.+'] # user flair not set 
comment: |
    Hello /u/{{author}}! 
    Don't worry, you didn't do anything wrong! It just looks like this is either your first post to our subreddit, or it's the first post since our recent approval process change as part of our ongoing efforts to reduce spam.  In order for your post to be approved and to show us that you're not a spam account, please reply to **this comment** with the words "`I agree`" and the reddit automoderator will approve your post, as well as any future posts you make.  
    Thank you!  

message_subject: "Action Required re: your recent submission to /r/{{subreddit}}"
message: |
    Hello /u/{{author}}! 
    Don't worry, you didn't do anything wrong! It looks like this is your first post to /r/{{subreddit}} (or your first post since our recent approval process change) In order for your post to be approved and to demonstrate you are a human and not a spammer, please view your post by clicking [here]({{permalink}}).  You should see a comment from the Reddit automoderator with instructions to follow.       
    Thank you! 

  • Part 3: If the original poster replies to the automoderator saying "I agree" - the automoderator 1) assigns user flair to them, and 2) approves the post. This is where you will use the "user flair ID" you copied in the preparation steps

---
# User replies "I agree" to automoderator comment - the post is approved and "New poster" flair is added for them.  
type: comment
body (regex): ['\bagree.*']
is_edited: false
author:
    is_submitter: true
    ~flair_text (regex): ['.+'] # Flair_text is currently blank
    set_flair:
        template_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx # ID for "New poster" flair 
comment: |
    Thank you and welcome to our community!  Your post has been approved and should be visible to other users at this time.  Your future posts will automatically be visible.  
 
parent_submission:
    action: approve
    action_reason: 'Post Approved - New poster.'

  • Part 4 - optional - you can have a second level flair to identify people who have posted more than once after verifying

---
# Identify and promote (update flair) when someone makes their second post
type: submission
author:
    flair_template_id: [xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx]  # User flair is currently "New poster"
    set_flair:
        template_id: yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyyyyy # setting them to "Contributor"
    overwrite_flair: true
action_reason: 'Post Approved - user promoted to contributor.'

That's it!

I still recommend reviewing the mod queue from time to time looking for submissions with multiple comments (to find posts where the user is *trying* to follow instructions and having problems.

1 Comment
2024/04/01
17:17 UTC

0

I need this automod code

Welcome to r/ . Please keep it civil. If you have any question, then contact the MOD team. Thanks

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

3 Comments
2024/04/01
17:14 UTC

1

how to add the AutoModerator to the subreddit?

recently became mod of a small subreddit and want to add the AutoModerator and I have a few questions about it

  1. how do I add it?

  2. how do I make him say an automated message (example: "if this post breaks any rules delete it")

  3. how can I make it delete some posts automatically?

6 Comments
2024/03/31
17:41 UTC

3

Auto delete low karma accounts posts?

I made a nudist group that is inundated with low karma porn bots. This is supposed to be a safe place for local nudists and more than anything I get onlyfans ads, often copying legit post titles.

2 Comments
2024/03/31
16:09 UTC

6

How to allow only Moderators to upload images in comments?

There's a subreddit feature where Mods can enable/disable images in comments if you are a Moderator of a subreddit that is not nsfw, which mine isn't.

"Mod Tools" -> "Settings" -> "Post and Comments" -> "Media In Comments" -> "Images"

However, I don't want to universally enable images in comments for all users, due to a multitude of reasons like low quality meme spam. I would like only mods to be able to include images in a comment. Does anyone know how to do accomplish this, either by the settings or an AutoModerator configuration?

I'm trying to mess around with the syntax "moderators_exempt: true" in AutoModerator, but I can't seem to get it to do exactly what I want.

---

type: gallery submission

moderators_exempt: true

action: remove

---

The above command should disable image posts for all users, with Moderators being exempt from the rule, but I couldn't find the equivalent for image comments. If anyone could assist me, I would really appreciate it.

3 Comments
2024/03/31
14:43 UTC

2

How can I set a user flair to ignore specific automod rules?

I want the users with user flair "Verified Store" to be ignored by auto mod rule 1 2 3 but not ignore by rules 4 5, how I can do that?

# RULE 1 CQS score

# Rule 2: New Account Filter

# Rule 3: Low Karma Filter for posts only

# Rule 4: Common Spam Keywords in Title and Comments

# Rule 5: Disallow Crossposts

1 Comment
2024/03/31
10:29 UTC

2

How to stop [or edit] the Automod signature?

Primarily, I wish to keep the "I am a bot, and this action was performed automatically." after each automod action.
But the invitation to argue about it :

Please contact the moderators of this subreddit if you have any questions or concerns.

is confusing to users and needs to be removed as there is plenty of info given in the custom text,
and can lead some people into feeling tricked when no debate is entertained.

I know this question has been asked and answered in years past.
But is there anything new on this issue?
Thank you.

10 Comments
2024/03/31
01:53 UTC

1

Need some help getting the approve action working correctly.

What I have set:

type: comment

author:

name: [name1, name2]

action: approve

I'm trying to make it so if someone is restricted by another automod rule (account age for example), they can be approved to the automod and still be able to comment.

This command is not working as the comments are getting removed and that is even after I moved this command to the very top of the auotmod page.

Any ideas on how to get this to work?

7 Comments
2024/03/30
17:18 UTC

3

Notify on link share in external sub / TotesMessenger

Hi folks,

Our Private sub has added a new rule, not allowing links to posts from our sub to be shared on other subs.
I came across the TotesMessenger in the AutoMod wiki, and have been trying to add it to the AutoModerator to alert us of external link shares.

I have added the following rule to our AM code:

---
# Reports sharing private links on other subs via modmail
  author: [TotesMessenger]
  body (regex, includes): ['\[(/r/\w+)\] \[(.+)\]\((https?://\w+\.reddit\.com/\S+)\)']
  action: remove
  action_reason: "Remove {{author}} comment after reporting thread, {{author}} is our friend [{{match-2}}]"
  modmail_subject: "Submission linked from {{match-body-2}}"
  modmail: |
    The following thread in /r/{{subreddit}} has been linked in {{match-body-2}}:  
    **Original:** [{{title}}]({{permalink}})  
    **Meta post:** [{{match-body-3}}]({{match-body-4}})  
---
  • Other rules in the AM preceding this one are working fine, this is the last in the list
  • As we are a Private sub, I have approved u/TotesMessenger in the sub, but did not add it to the moderators

Questions:

  1. Am I trying to do something impossible?
  2. Should I modify the body regex to include the name of our sub too?
  3. Does this only work on crossposts and Link type posts, or also on Text type posts containing text AND a link to a post on our sub?
  4. If TotesMessenger is not the best way forward, what alternative(s) can you suggest?

Apologies if I am misunderstanding the functionality of TM here, appreciate any push in the right direction here :)

0 Comments
2024/03/29
14:32 UTC

2

Automod not reverting.

I took down my automod so I could clean up my spaghetti code, but I had the foresight to copy that code. I am trying to get my automod to accept my new code and it won't, whatever, formatting probably, but then I try to paste the code I have from before and it won't accept that either. I tried to break up my original code into each
---

segment

---

but it still won't take the code. Help me out?

19 Comments
2024/03/29
02:35 UTC

1

Automod for Image Posts

My subreddit has a script for the automod to post a comment on every image post with a general message and sub rules, however it doesn’t work run when the user submits multiple pictures. Can anyone help? My script is as follows:

type: submission

type: link submission domain: [i.redd.it, preview.redd.it, old.redd.com, imgur.com, instagram.com, tiktok.com] url (includes-word, regex): ['.=', 'i.redd.it', 'imgur.com', 'ibb.co', 'prnt.sc', 'postimg.cc', 'imgbox.com', 'imageupload.io', 'instagram.com', 'instagr.am', 'fbcdn.net', 'flickr.com', 'giphy.com', 'gfycat.com', 'media.tumblr.com']

comment: |

Text here

4 Comments
2024/03/28
22:40 UTC

0

If someone comments a keyword on a post, have it sent to the modmail.

If someone comments "Bad!' on a post, send it to modmail.

Is this possible?

1 Comment
2024/03/28
21:29 UTC

1

Need some help with an automod code

Hi,

In my subreddit we want to block everything for review that contains karma and free, but the current code blocks everything that contains karma or free.

type: submission
body (includes-word): ["free", "karma"]
action: filter
modmail_subject: "Post flagged for restricted terms"
modmail: |
  Your submission has been flagged for containing restricted terms and has been sent to the moderators for review. Discussing karma-sharing subreddits is against Reddit's Terms of Service (ToS) and is not allowed on this subreddit. Please refrain from such discussions in the future.
8 Comments
2024/03/28
06:07 UTC

1

Age and gender tag issues

Currently having an issue with the following code:

# Title Formatting
type: submission
~title (regex): ['(1[89]|[2-9]\d)*\s*\[([TFMG]|NB)4([TFMGA]|NB)\]']
action: remove
action_reason: 'Incorrect Title Formatting'
priority: 85

The code should force submission titles to have a numerical age between 18 and 99, and also require a gender tag between square brackets. However, it isn't removing submissions that lack an age. I'm sure it's just some slight formatting thing but I'm having trouble seeing it. Thanks!

1 Comment
2024/03/28
01:36 UTC

1

How to filter old.reddit image galleries

I have an image filter setup for reddit image posts. However, some posts are submitted as galleries, they link to old.reddit.com. Is there a way to filter there?

I'd also be interested in filtering image links within the body of posts. These: https://preview.redd.it/

I currently filter link submissions for "i.redd.it" and I'm not sure this will catch "preview.redd.it" in the body

6 Comments
2024/03/27
23:53 UTC

Back To Top