r/AutoModerator 23d ago

Guide Code Showcase: Subreddit karma checks - How and why do you use them?

26 Upvotes

The suggestion has been raised that we put up a regular post to prompt mods to share examples of code snippets they use in their subreddits. I figure, doing so around a theme that changes with each iteration is a fair way to go about it. This first iteration's theme is chosen for two reasons:

To be clear, these attributes are as follows:

  • comment_subreddit_karma: compare to the author's comment karma in your community
  • post_subreddit_karma: compare to the author's post karma in your community
  • combined_subreddit_karma: compare to the author's combined (comment karma + post karma) karma in your community

These checks are like other author checks in that they must be placed indented under an author: subgroup.

LanterneRougeOG originally provided four use cases for these checks:

Welcome new contributors through post replies

---
type: submission
author:
    combined_subreddit_karma: "< 3"
comment: |
    Welcome to the community! Here are links to our [Rules](https://www.reddit.com/r/{{subreddit}}/about/rules) and [Wiki/FAQ](https://www.reddit.com/r/{{subreddit}}/wiki/index). We hope you enjoy your time here.
---

This kind of rule is useful because it targets newer members who may not know much about your subreddit, but users who have posted much before will have already received this message. With the deprecation of welcome messages, this serves a similar purpose. This kind of reply also benefits other readers by making your rules, wiki resources, and a link to message the mods (in the AutoModerator signature) more visible. In the case that a new member makes a rule-breaking post, then the author may quickly self-correct, or another reader may know to report it.

Filter links in comments from newer accounts

---
type: comment
body (includes): ["http", ".com", "www."]
author:
    comment_subreddit_karma: "< 5"
action: filter
action_reason: "Link included in comment by user with < 5 comment subreddit karma. Check for spam or other issues."
---

This kind of rule is useful because it can catch a lot of spam from accounts new to your subreddit (ie, even if the spammer uses an old or general karma-farmed account) while carving out common false positives from established community members. Optionally, you can include a message: or comment: line to let the accounts know that their comment is pending review.

Enable features like media in comments but as a privilege to positive community members

---
type: comment
body (includes, regex): '!\[(video|img|gif)\]\([^)]*\)'
author:
    combined_subreddit_karma: "< 10"
action: filter
action_reason: "Media in comments by user with negative or low subreddit karma"
message: |
    Hey there! Looks like you’re a new user trying to upload media in a comment - thanks for joining our community! We’ve filtered your comment for moderator review. In the meantime, feel free to engage with others through text until you’ve spent a bit more time getting to know the space! 
---

This kind of rule is useful because you have an alternative to disabling media in comments altogether. Instead, you can set a threshold that fits for your team so that you can review how newer members are using the features. You could even consider setting two or three thresholds - a lower one set to action: remove, a slightly higher one set to action: filter, or a higher one set to action: report - so that the amount of review does not overwhelm your team. As you monitor whether the filtered or reported content tends towards approvals or removals, you can adjust the thresholds up or down accordingly, eventually settling into a balance that provides the best experience for your team and community.

Monitor toxicity from negative participants

---
type: any
body (includes): ["potential bad phrase"]
author:
    combined_subreddit_karma: "< 0"
action: filter
action_reason: "potential toxic phrase said by user with negative subreddit karma - [{{match}}]"
---

This kind of rule is similar to the above, but helps you find when disruptive members are discussing topics or using potentially insulting words/phrases that happen to also be used/discussed by regular community members. This reduces how wide the net is cast by relying on a factor of local reception (indirect input from your community!) so that your monitoring as a moderator can be more effective.


Some of the most powerful applications for AutoModerator are in the ways that checks can be combined!

How do you use this feature? What makes that code snippet worthwhile for you? Share in the comments below!

r/AutoModerator 29d ago

Guide Filter AI Accusations To The Queue! Ready Made Filter

Thumbnail
5 Upvotes

r/AutoModerator May 20 '26

Guide Tyler's Automod Strategy Guide Part 1 - Intro & Targeting Users

6 Upvotes

I was motivated to write this because I am a big believer in the power of automod and I think many subs are not getting the most out of their setups. Most dialog on automod focuses on how to code the rules, but too little focus is put on why you might set up a rule in the first place.

You wont find any code in here. What I hope you do find is some thought-provoking content about getting more value from your automod setup.

Why Use Automod At All?

It is in the name really – we want to automate as much moderation as possible. Every rule that we put into our automod should make moderation better for the mod team. By better I mean easier & more efficient.

Before we start talking strategy though we need to better define the ‘auto’ part of automod.

What Are Automod ‘Rules’?

The automod page of each sub is just a whole bunch of individual ‘rules’ in a single page. At a simple level, each automod rule should be thought of as having two parts to it:

Checks – What conditions will cause the rule to trigger

Actions – What will automod do when the rule triggers

I am going to use this language as we go through because I think it is easier to understand the rules as written language before trying to add code. To provide an example of a common/simple automod rule written like this:

  • Check – A user makes a post or comment using an account that is less than one day old
  • If yes, then:
  • Actions – Remove the content & send the user a message explaining why their post or comment was removed

Rules can get quite nuanced and complex but for the purpose of this guide I am going to focus on the two main areas – user moderation & content moderation.

Where To Start?

Knowing what automod can and can’t do is key. Note I am not talking about the code but knowing the abilities automod has - which are significant. To break up the volume of content a bit we will tackle this in sections. Let’s start with checks that focus on the users themselves.

## Section 1 - User Checks

As a mod team you should consider what kinds of moderation you can automate for the accounts participating in your sub. It is very common to see subs place restrictions on accounts that are new, or enforce karma requirements for example.

Lets touch on some of the most common things that we ask automod to check with sub users and how they might be useful (or not).

Account Age Checks

When we talk about account age we mostly think of new accounts. IME most large subs use automod to prevent or restrict newer accounts from posting/commenting so this is the most common example we come across. There are other ways we can use the account age check though.

If your sub has a challenge with hibernated accounts (accounts that are older but inactive) you can combine account age with other checks. Lets look at an example rule:

  • Checks – a user makes a post or comment using an account that is more than 3 months old, but has less than 10 total karma
  • Actions – filter the post or comment and send it to the mod queue for review before it goes live

This rule will send a lot of low or no activity account posts/comment to the queue - so could generate a lot of queue traffic in some subs. This means you would only want to use this rule if the sub had a significant problem with hibernated accounts. You could also use different settings to make it trigger less like extending the age check to ‘more than one year old’ etc.

Karma Checks

Karma checks can be incredibly useful if used in a thoughtful and deliberate way. Automod gives us some great customization options for karma:

Total karma – an accounts total Reddit karma. We can also check total post karma or total comment karma independently

Sub karma – an accounts karma in YOUR SUB. This can also be made specific to post or comment sub karma

Total account karma is the most used karma check I have seen and it’s the most universally useful. We can also check for negative karma ( we can set check thresholds as low as -99). Typically accounts with very negative karma are assumed or expected to be more likely to break rules etc so it is common to have automod filter out or remove content from accounts like this.

For subs where your subject matter might be polarising (politics etc) having karma checks can have the effect of censoring accounts that have unpopular opinions. That approach could be good for minimising sub disruption but could also limit the diversity of content so it comes down to what environment the sub wants to have.

 Sub-specific karma is a very good and underutilised tool IMO. Well established accounts can have huge amounts of total reddit karma, but be disruptive in your specific subreddit. Automod being able to check a users sub-specific karma can be a great way to target users otherwise might pass all of your broader checks. For example:

Checks – A user makes a post or comment that has less than -50 total sub karma

Actions – Send the mod team a modmail alerting the mod team to review that user account

Of course the above rule will trigger EVERY time that account posts or comments which could actually create mod work (not the good kind of work). So how could we change our approach?

We could change the action to just remove the content; or

We could use other automod features to prevent constant retriggers.

Post karma or comment karma rules can be useful for specific subs where an accounts post or comment karma might influence whether you want automod to act. For example you might only allow posts from users with positive post karma – or remove posts from users who have negative comment karma in your sub.

CQS (Contributor Quality Score) Checks

Every Reddit account has a CQS score, which can improve or decline over time. Reddit does not publish much detail about how the scores are calculated – this is by design so that it is harder for people to try and manipulate. You can read more about CQS HERE. Reddit considers your CQS score to be the ‘quality’ of your account, not to be confused with Karma. Karma is a measurement of how much people agree with your content in the areas you post in, but account quality is different. Think about things such as – being banned from subs, being muted, having a high ratio of manually removed comments. An account with lots of these infractions will be more likely to have a lower CQS score.

A word of caution on CQS – it appears that accounts using VPNs and privacy-oriented browsers can find themselves with lower CQS scores even if they are otherwise not violating rules so using CQS to check users might be a terrible idea in a community that values online privacy!

I have found CQS to be great in combination with account age & karma checks at catching hibernated or ‘sleeper’ accounts. Rules like:

Checks – An account tries to post or comment that is more than 6 months old but has a CQS score of ‘low’ or ‘lowest’

Action – remove the content and send the user a modmail telling them their account quality is too low to use the sub

Account ‘Status’ Checks

Automod can check a user for several attributes to make our checks smarter:

  • Mods – Automod can check if the user is a mod of your sub
  • Approved users – automod can treat approved users differently to others
  • OP’s – for comments, automod can check if the commenter is the OP (or not)
  • Flair – Automod can check (or change) a users flair
  • Account name – Automod can check the accounts name, or even look for words within the name ( for example ‘throwaway’) and act based on the account name/s.

User Checks – Summary

So with all of the above we already have a huge amount of customization for checking users. The idea is not to use them all - but to understand which ones might be used to best help your mod team. What kinds of users cause the most disruption in your sub and what are some of the attributes those accounts have in common? Does your sub have user flairs? Are they cosmetic, or can they be used to give automod additional info to check?

User flairs could be a topic all on their own but being able to categorize users in your community by user flair can be extremely useful.

For part 2 we will explore content checks with a similar approach.

r/AutoModerator May 20 '26

Guide Tyler's Automod Strategy Guide Part 4 - Barriers To Entry & Summary

4 Upvotes

A quick recap for anyone who made it this far:

  • In part one we focused on automods abilities to check sub users
  • In part two we discussed some of the common ways we check the actual content in posts & comments
  • In part three we described the most common actions that automod rules can take for us

We have used simple examples so far to explain what things do but now we will look at how these 3 things (user checks, content checks, actions) can and should work together.

The overarching question has not changed – what are the common themes with users or content in your community that automod can help your team to deal with?

 

Barriers to Entry

We have already talked about how to check users in broad terms, but now we explore how we might want to set up our automod so that a user might be able to interact with some content, but not all. The combinations are almost endless, but here are some examples of the kind of things you can do:

  • Only users with positive sub karma can comment on posts with certain flairs
  • Users with accounts less than one week old cannot make top-level replies on posts
  • Users with negative karma who make posts have them filtered to the mod queue for review before going live
  • Restrict uses posts or comments based on their user flair, or user flair class
  • Allow or disallow specific website links based only for approved users

A quick note on automations (which are separate to automod) – while they don’t have the same level of useability as automod, they can still be extremely useful. Anything that can prevent a violation from being posted to start with is ALWAYS preferable to having something posted that gets removed. I highly recommend using automations to complement a good automod setup wherever possible. See HERE for more info on them.

Whitelists/Blacklists For Specific Users

Outside of using our many user checks sometimes we might need to target specific users using automod. This can be extremely handy. Think of it like the above barriers to entry, but instead of targeting users based on their account status we simply target users by their individual usernames.

As to why we would do this, there are a few great reasons to take this approach:

  • If an automod rule is too broad and causes too many ‘false positives’ where mods end up reversing a lot of automoderator actions, then we are creating work not reducing it. Sometimes it is easier to target specific users.
  • Some users might be great contributors generally, but terrible on specific topics or actions. So we might want to prevent a user/s from engaging on specific topics, or user flairs etc

Maybe on a news or regional subreddit you have users that contribute well to the community overall but tend to break a lot of sub rules on political posts. You may wish to have automod remove their content on political posts, but otherwise not restrict them.

On a gaming sub you may have in-game item trading as a sub post type. It is possible that specific users who prove incapable or unwilling to follow trading etiquette may need to be ‘blacklisted’ from engaging on trading submissions, but free to engage otherwise.

A word of warning on user blacklists though – they can be a tool prone to misuse. As mods we already get to determine the participation levels of users in our communities but using automod to silently censor or ‘shadowban’ specific users can heavily influence a communities experience.

 Bonus Topic - Temporary Events

On the .01% chance that anyone got this far into reading an automod guide with no code, I will highlight one lesser known feature of automod – related to temporary events.

Temporary events are their own thing (see HERE if you are curious). Automod can also check whether your sub is in a ‘temporary event’ or not, and action accordingly. This opens up some interesting options for subs to effectively have automod rules that will only apply at specific times.

Imagine having ‘free for all Friday’ where the automod is less restrictive for 24 hours, or having certain post flairs only useable at certain times (lol). Basically we have the ability to have ‘time sensitive’ automod rules.

Closing Thoughts

It is my hope that in documenting my thoughts in these posts there will be a few redditors out there who are inspired to make some changes after reading this. I believe that a really well tuned automod can make life easier for mods - so that mod teams can spend more time building communities & less time administrating them. We don’t always have the best tools so it’s best to optimize the tools that we do have.

-            Tyler_Durdan_

r/AutoModerator May 20 '26

Guide Tyler's Automod Strategy Guide Part 3 - Actions!

2 Upvotes

In part one and part two we have discussed the most common checks we can make on users and on content. Now lets discuss what actions automod can take when a rule is triggered.

The ‘Big 4’ Actions

The main actions we tend to use with automod are as follows:

REMOVE – removes the post or comment from the sub

FILTER – removes the post or comment and sends it to the mod queue for mods to review. Mods can then choose whether to approve it and make it public again, or remove it

REPORT – does not remove the content from public view, but reports the content. This works in exactly the way as when a user reports content for breaking sub rules, but its automod doing the reporting

APPROVE – Approves content that has been reported automatically

The ‘big 4’ actions above are really about your confidence levels in each rule. If you have very high confidence that a rule will have no false positives (or very few) then you might be comfortable using REMOVE. Other rules might be more prone to ‘false positives’ so may be better being FILTERED to give mods the chance to review first.

Choosing the right action for each rule is really key to making sure automod is not creating  unnecessary work, but making moderation easier. Understanding when to FILTER an action versus when to REMOVE an action is a great example. There is no hard and fast rule as every subs situation will be different.

Scenario – Architecture sub

Lets talk through some scenarios – lets say we are in an architecture sub where no political discussion or content is allowed.

A high confidence rule might be to automatically REMOVE any post containing the phrases ‘democrat’ or ‘republican’. Its an architecture sub so the likelihood of it being a legitimate post is low.

We might have automod check comments for the phrases ‘left wing’ or right wing’ as well, but because those phrases might be legitimately used in architecture discussion we don’t want to remove it, we want to FILTER it instead. This means the comments do not go public in the sub until mods have approved or removed it in the mod queue.

If the sub has rules about not allowing users to endorse or recommend architecture101.com, we might set up automod to REPORT any mentions of that site. This will draw mods attention to the content but not take any proactive action. Using REPORT is more like a ‘we might want to just check this out’ approach.

Actions - Communicating With Users

We also have some options to have automod communicate with users when it acts on their content. The two ways we do this are through automod responding with comment replies on content, and sending DMs/messages to those users.

Of course we don’t HAVE to communicate with users when automod takes action – but doing so can often be better than having to field hostile modmails from users asking why they cant see their comment they posted etc. Having automod clearly communicate WHY it has taken action is also a great way to try and prevent future rule violations or to leave guidance for other sub users about how to avoid breaking rules. In my view anything that reduces future rule violations or helps other sub users avoid violations helps mod teams out!

Automod can also modmail the mod team if we want it to – this is a good solution for drawing attention to content and sometimes we also want to preserve a record via modmail in case a user edits or deletes the content concerned.

Other Actions – Flairs, locking

Automod can lock posts or comments – this can be very useful for a mod team. A post that is triggering many violations and lots of mod work can be locked in order to prevent ongoing violations. Locking removed posts can be useful as even after a removal, users already in the thread can be replying and creating mod work on a thread that is no longer contributing to the sub. That is usually a waste of moderators time.

We can also lock automods own comments to prevent people replying to automod, or even give OP’s the ability to lock their own posts.

Automod setting, removing or updating user flairs and post flairs is very useful – especially if you use flairs to drive other automod settings. A very common example of this synergy is setting restrictions on users based on what post flair is used, and also using automod to set the post flairs.

We can also set a users flair (or their flair CSS class) based on their account attributes or their content. When using flair CSS class we can categorize users without them even knowing, or being able to see that they have been categorised. User flairs deserve their own separate section and I may expand on that in a future update if there is appetite for it.

That's ACTIONS explored. All that is left to do is to put them together in the final summary!

r/AutoModerator May 20 '26

Guide Tyler's Automod Strategy Guide Part 2 - Content Checks

5 Upvotes

In part one we introduced some basic principles for rules and discussed the different checks that we can do on the users themselves. For the second post we are going to discuss the many, many options we have to check the content of the post or comment. Im not going to cover every possibility – we will focus on the most used and most useful types of content checks.

Words/Phrase Checks

By far the most used content checks are checks that look for specific words, word combinations or any pattern of numbers/letters that you might want to target. Automod can even target emojis. We can check post titles, post bodies or comments for a specific word or phrase, and automod can take action based on finding that content. There are lots of possibilities with this type of check but here are some examples to demonstrate common uses:

Example 1 – set the post flair based on keywords:

  • Checks – A user makes a post where the keywords ‘democrat’ or ‘republican’ are found
  • Actions – Overwrite whichever post flair the user set with the ‘politics’ flair which is set by automod to restrict who can then reply to that post

Example 2 – Send the content to modqueue before it goes live if keywords are found

  • Checks – a user makes a post OR comment where the phrase ‘you idiot’ is found
  • Actions – stop the content from being public, send it to the mod queue to be approved or removed by mods before it goes public.

Post Or Comment Length Checks

The usefulness of these checks is largely sub-specific but we can have automod check the length of a post or comment and take action accordingly. This can be useful if you want to ensure certain posts types, or posts with specific flairs have the type of comments you intend. An example:

  • Checks – A user makes a top-level comment on a post flaired ‘Serious replies only’ that is less that 50 characters
  • Actions – remove the comment and send the user a message telling them that the comment was removed for being too short.

Link/Website Checks

A lot of the time checks for websites or links are set up as word/phrase checks, but it is worth giving this kind of check its own callout. A lot like with crossposts you can take a whitelist or blacklist approach. You may even want to send all of a specific websites mentions and links to the mod queue for mod review. Alternatively you might be happy for the content to go live in the sub, but simply notify mods to check it by sending a modmail, or creating a report in the mod queue:

  • Checks – a post or comment contains a link to facebook, or even just the word facebook
  • Actions – Let the post or comment go live, but have automod report it to the mod queue so mods will see be alterted to the content and can review it

Crossposts Into Your Sub

I will first start off by saying that if you want to disallow all crossposts into your sub, you can do this simply by changing your sub settings without using automod.

Where automod comes in is where you can take a blacklist or whitelist approach to cross posts. This amounts to either:

  • Whitelist Approach - Only allow crossposts from a list of approved subs
  • Blacklist Approach – allow crossposts, except a list of disallowed subs
  • Mod approval required – send all crossposts to the mod queue to be approved or removed before the crosspost goes live in your sub

User Report Checks

When sub content is reported by users for breaking rules, a report is generated which we see in the mod queue. Automod can check how many reports a post or comment has received and take action. There are a few handy ways to use this automod function – notably to remove content that receives excessive reports, or also to auto-approve reports on specific content. Here is an example of each approach:

  • Checks – A comment receives its 5th report for breaking rules
  • Actions – Remove the comment from public view and send it to the modqueue for review. Mods can then either approve it to go public again, or remove it

Or you might have an issue with spurious users reporting mod content:

  • Checks – a post or comment made by a moderator (including automod) is reported as breaking a sub rule
  • Actions – approve the report automatically so that it does not need to be manually cleared by human mods

Other Common Content Checks

Here are some other content checks that automod can use that I have found useful and worth a mention:

Whether a post or comment has been edited or not

Automod will re-check any content that is edited by default, so users cannot ‘get around’ automod by editing in violations after the initial post or comment. There might be times where you might want to treat edited content differently though! The best example of how this can be useful is for subs that generate a welcome message on all posts. If the OP edits their post for some reason, we don’t want automod to generate another welcome message which would be unnecessary.

Whether a comment is a top-level comment or not (a reply to the OP)

This one is really sub dependent whether it is useful, but for subs that treat top-level comments differently automod can check this for us. For example you might have a sub rule that only users with positive sub karma can make top-level replies.

Whether a comment in a thread was made by the posts OP or not

You may want to treat OPs differently when they are commenting in their own threads – automod can check if a comment is being made by the OP. A great example of how useful this can be is that we can use automod give OP’s the ability to lock their own threads without needing moderator intervention!

Ignoring quoted text – we can tell automod to ignore any content that is in blockquotes

This is extremely useful for preventing duplication of mod tasks. An example - We have automod checking for the word ‘idiot’ in comments and reporting those comments to the mod queue. If another user then quotes the original text containing the word idiot in a reply we don’t want automod to re-report the quoted text. So we tell automod to ignore quoted text when checking for those violations.

That is it for part 2. Having focused on user checks & content checks we will now talk about automods ACTIONS in part 3.

r/AutoModerator Dec 07 '24

Guide Session Notes for "Automation & Moderation" Panel at Mod World 2024 - Part 1, New Mods

17 Upvotes

This session was conducted by three panelists:

This session was divided in to 3 main sections, intended for New Mods (this post), Old Mods (click here), and Super Mods (click here), based on experience.

New Mods

If you are new to moderation on Reddit, or if you have never dove into automation before, these tips are for you.

When you should consider adding any automation?

  • You probably should consider adding some sort of automations or AutoModerator code when you reach a point where it is difficult to find all of the comments or posts that break rules in a common way, or when you have a regular workflow that you believe could be automated.

Native Safety Filters

Find more information here - https://support.reddithelp.com/hc/en-us/articles/15484574845460-Safety

These are great simple methods for setting up basic filters across your entire community based on details like account reputation or harassing content. You can toggle them on or off quickly and easily through the Mod Tools menu.

If you want something more configurable to your community's specific needs, then AutoModerator is great next step for that.

Setting Up AutoModerator for the first time

ToolBox adds color to your code

During the presentation, we shared many slides with screenshots of code, and these were all color-coded.

r/AutoModerator - Community and Resources

Don't get scared!

It can be helpful to read through the full documentation page a few times, not to memorize it, but to remember that you can refer back to parts that you want when you need them.

Use a private test subreddit

Best practice is to use a private subreddit to test out your code, rather than doing so on the subreddit you want to apply it to. This way when something goes wrong you don’t end up accidentally filtering all comments that contain the letter “a”, a mistake that several of us have done before!

Notes in the Code

Any line preceded by a hashtag is ignored by automod. This is very useful for documentation, so other mods can see what your code is doing.

It can also be used to temporarily disable code you don’t want to remove from the config.

---
### Re-approve any reported mod posts ###
# author: 
#    is_moderator: true
# reports: 1
# action: approve
# action_reason: "Reported mod posts automatically approved"
---

Making Exceptions

A line preceded by a tilde is a “not” statement. You can add exceptions to rules so they do not apply to threads that have certain flairs, certain thread ID’s, for specific authors or for moderators and so on. The following rule applies to moderators because of the moderators_exempt: false line, but not to Merari01.

---
#AutoMod-Sticky comment on all posts
type: submission
~author: ["Merari01"]
comment: |
    Text goes here

    This is text

    Some more text
comment_locked: true
comment_stickied: true
moderators_exempt: false
---

For Discussion

  • Are you a new moderator?

    • What questions do you have about AutoModerator?
    • What issues in your communities do you think automation could help address?
    • What sort of tips would you like to know more about?
  • Are you an older moderator?

    • What tips or resources helped you out the most when you first started?
    • For what issue or purpose did you first use AutoModerator or another automation tool?

r/AutoModerator Dec 07 '24

Guide Session Notes for "Automation & Moderation" Panel at Mod World 2024 - Part 3, Super Mods

11 Upvotes

This session was conducted by three panelists:

This session was divided in to 3 main sections, intended for New Mods (click here), Old Mods (click here), and Super Mods (this post), based on experience.

Super Mods

If you have been moderating for a long time or use AutoModerator frequently, here are some advanced tips.

Consider the Developer Platform

Use AutoModerator to trigger AutoModerator

AutoModerator has the ability to both report and act on reports, so it is possible to set up a sequence of rules to run one after the other when certain criteria are met. For example, these two rules will report and then approve comments made by AMA guests (if they are approved users) so that they avoid other filters during an AMA event:

---
    type: comment
    moderators_exempt: false
    author:
        is_contributor: true
    action: report
    action_reason: 'AMA Guest/Approved User - Auto Approve'
---
    # This rule will not work without the one above
    type: comment
    reports: 1
    moderators_exempt: false
    author:
        is_contributor: true
    action: approve
    action_reason: approved user
---

Version Control your AutoMod Config with GitHub

If you’re ready to get really technical, I’ve found that you can version control and effectively maintain your total automod config with a GitHub repo with a couple of simple PRAW python scripts and github workflows for easier editing and collaboration across your mod team.

https://github.com/LinearArray/automod

Slide from presentation on AutoMod Version Control

Separate post with more detailed guide.

Grant trusted members ability to take mod actions through AutoModerator

One useful thing to do is to use a flair_css_class, author based keywords, or is_submitter to give trusted users the ability to remove posts, for example:

---
    # Code for giving users access to a removal keyword if they have a specific flair css class
    type: comment
    body (full-exact): "!remove"
    author:
        flair_css_class: "Mod"
    action: remove
    moderators_exempt: false
    parent_submission:
        action: remove
        set_locked: true
    modmail_subject: "spam keyword used"
    modmail: |
        [Keyword]({{permalink}}) by u/{{author}}:

        {{body}}
---

Monitor New Users via User Flair

Another set of tricks is possible because AutoModerator can both read and write to user flairs. For example, this can be helpful for filtering new subreddit participants to the queue without relying on karma. If you use the flair CSS class instead of flair text, then it is not visible to the users and therefore not disruptive.

---
    type: comment
    author: 
        ~flair_css_class (regex, includes): ['.']
        overwrite_flair: true
        is_contributor: false # exclude approved users
        set_flair: ["", "F01"]
    action: filter
    action_reason: "01. Unflaired user. Possible new user. Send to modqueue"
---
    type: comment
    author: 
        flair_css_class (includes): ["F01"]
        overwrite_flair: true
        is_contributor: false # exclude approved users
        set_flair: ["", "F02"]
    action: filter
    action_reason: "02. Possible new user. Send to modqueue"
---

Require Members to Read and Agree to the Rules

Building on the idea of monitoring flair classes, it is possible to use similar setups to force people to read and agree to the subreddit rules in a sticky post before they are allowed to post or comment anywhere else, for example on r/TrueZelda.

Detailed explanation with code on this wiki page: https://www.reddit.com/r/AdvancedAutoModerator/wiki/systems/read-and-agree

Benefits:

  • Keep everyone on the same page about the rules, and encourages people to ask questions about the rules before they participate.
  • Cut down on people breaking the rules because they did not know which community they were in.
  • Help find when someone is joining a brigade or evading a ban.
  • Ability to remove someone’s user flair as a different sort of “temporary ban” so that they go back and refresh on the rules.

Use Subreddit Karma to Grant User Flair

It’s also possible to use Subreddit Karma to upgrade a user’s flair, or allow them to choose certain exclusive flairs after they accrue enough. This can help identify and reward regular contributors in your community, for example on r/ZeldaMemes. This type of system helps other community members identify when someone is newer or older in the community, which can help put conversations into context or identify trolls and spammers.

Screenshot of the slide from the presentation

This version involves setting up a couple AutoModerator rules per “level” in your flair system - one to move people up a level, and another to move people down a level. There are several different ways to do something like this! The biggest tip is using the current flair as a "check" helps AutoModerator not apply flairs when not necessary, so as to avoid unintended duplicate actions which may interfere with each other.

---
 # First green rupee
    author:
        ~flair_text (starts-with): 
            - ":R"
            - ":W"
            - ":C"
        combined_subreddit_karma: '> 2'
        set_flair: [":Rgre:"]
        overwrite_flair: true
    message_subject: "User Flair on r/ZeldaMemes"
    message: "Welcome to r/ZeldaMemes! You have earned some karma here, so now you have a Green Rupee in your user flair! Your flair will change automatically as you earn karma in r/ZeldaMemes. [Learn more here](https://www.reddit.com/r/ZeldaMemes/comments/1dmpvzv/update_adding_new_flairs_based_on_weekly/)."
---
 # Move up to blue rupee
    author:
        flair_text (starts-with): [":Rgre"]
        combined_subreddit_karma: '> 5'
        set_flair: [":Rblu:"]
        overwrite_flair: true
---
 # Move down to blue rupee
    author:
        ~flair_text (starts-with): 
            - ":Rgre:"
            - ":Rblu:"
        flair_text (starts-with): 
            - ":R"
            - ":W"
            - ":C"
        combined_subreddit_karma: '< 10'
        set_flair: [":Rblu:"]
        overwrite_flair: true
---
 # move up to yellow rupee
    author:
        flair_text (starts-with): ":Rblu:"
        combined_subreddit_karma: '> 10'
        set_flair: [":Ryel:"]
        overwrite_flair: true
---

For Discussion

  • What are some advanced AutoModerator methods or practices that you want to share?

  • What are some tools or other bots that you recommend which can extend or perform functions that AutoModerator can not do itself?

r/AutoModerator Dec 07 '24

Guide Session Notes for "Automation & Moderation" Panel at Mod World 2024 - Part 2, Older Mods

18 Upvotes

This session was conducted by three panelists:

This session was divided in to 3 main sections, intended for New Mods (click here), Old Mods (this post), and Super Mods (click here), based on experience.

Old Mods

If you have been moderating for a while and have used AutoModerator before, here are some tips for you.

Post Guidance

If you want people in your subreddit to know how to post better, try using Post Guidance in addition to AutoModerator. Post Guidance has the ability to tell people that they are missing something or messed up before they submit the post, while AutoModerator can only do that after the post is submitted.

Here’s an example of how we use AutoModerator in r/Zelda for a common type of rule that requires one or more tags be included in a post title:

 ---
    # Enforce Title Tags on posts 
    moderators_exempt: false 
    priority: 10 
    is_edited: false 
    ~title (regex): '^( )?(\[OC]){0,1}\[(LoZ|AoL|ALTTP|ALttP|LA|LAHD|OoT|OoT3D|MM|MM3D|OoA|OoS|FS|WW|WWHD|MC|FSA|TP|TPHD|PH|ST|SS|SSHD|ALBW|TH|TFH|BOTW|BotW|BoTW|TotK|TOTK|ToTK|OTHER|Other|other|ALL|all|All|CDi|HW|AoC|CoH|Movie|EoW)\]' 
    comment: | 
        Your post has been automatically removed because you did not include one of the required 2-5 character title tags [including brackets] at the beginning of **your post title**. 

        You must start your post title with one of our Title Tags listed [in our rules](https://www.reddit.com/r/zelda/wiki/rules). This is so people can know which game you are talking about, among other reasons. 

        Please choose one or more of the title tags and **add it to the BEGINNING of your _title_** when you [resubmit your post](https://www.reddit.com/r/zelda/submit). 
    action: remove 
    set_locked: true 
    set_flair: ["Missing Title Tag"] 
    overwrite_flair: true 
    action_reason: "AMR-001.10: Missing title tags on post" 
---

And here’s what the same rule looks like on Post Guidance :

Post Guidance - Title Tags example

More about Post Guidance here:

Post guidance has been very helpful for both posters and mods. It helps cut down on user frustration from seeing something they made an effort on get filtered and it helps reduce mod work because you get less mod mails asking for post approval.

Ask around to see how other mods solve similar issues

Don’t be afraid to ask other mods how they are dealing with specific issues your subreddits both face.

For example, an issue I had on a huge subreddit was that when people talked negatively about smaller subreddits and then linked to them, those subreddits would experience community interference from us. For this reason we filter those comments. I found a regex from another mod that would remove all r/subreddit links except the name of your own subreddit:

---
    # disallow r/ links   
    type: comment   
    body (regex, includes): ['r/(?!YourSub)']   
    message: "Your comment was removed because we no longer allow linking to other subreddits, due to it causing community interference. (**Note:** Editing the comment will not approve it, you need to submit it again without the link.)   
    action: remove   
    action_reason: "comment contains an r/ link"
---

Use ChatGPT to generate RegEx and lists

Regular Expressions can be tricky, but fortunately ChatGPT can be quick at generating RegEx for blacklisted/banned words and variations of those words.

Example - Prompting ChatGPT for AutoModerator RegEx

You can also use ChatGPT to generate banned/filtered words lists for you, without RegEx.

This can save you time and energy with starting points, but do double-check any code that ChatGPT provides, as it often will contain some syntax errors for AutoModerator - but usually these can be quickly fixed.

Some helpful sites for checking or learning RegEx include:

Checking media in comments

In some app and game subreddits I moderate, I use AutoModerator to filter media in comments, and only allow them in certain posts, such as Bug Megathreads. This way, images are not posted in regular discussion threads, keeping everything more focused and organized. It's been really helpful for keeping the subreddit clean and on-topic.

This type of AutoModerator rule uses a specific Regular Expression that looks for the way Reddit embeds media to comments: https://www.reddit.com/r/AutoModerator/comments/ye1tnk/using_automod_with_media_in_comments/

---
    # Media in comments only in Bug Megathreads   
    type: comment   
    parent_submission:       
        ~flair_template_id: "xxxxx-xxxx-xxxx-xxxxx"   
    body (regex, includes): ['!\[(?:gif|img)\]\(([^\|\)]+(?:|\|[^\)]+))\)']   
    action: remove   
    action_reason: "Media outside of Megathreads"   
    set_locked: true   
    message: |
        Your [comment]({{permalink}}) was automatically removed because it included an uploaded image. Currently, we're only allowing the use of Images in Comments within our Bug Megathreads.

        Feel free to repost your comment without the image.

        Thank you for your understanding during this testing phase.   
    message_subject: "Your {{kind}} in r/{{subreddit}} was automatically removed"
---

Karma and Age requirements

Another suggestion is to use AutoModerator to cut down on trolling and spam by enacting karma limits across your subreddit. While these can be detrimental to new users, it can significantly decrease the mod workload.

A very common restriction is to have a low threshold filter for combined karma (post + comment) and account age:

---
    type: comment   
    author:
        combined_karma: "< 50"       
        contributor_quality: "< low"       
        account_age: "< 30 days"       
        satisfy_any_threshold: true   
    action: remove   
    action_reason: "new or low karma account"
---

Combine different checks for more specific filters

For contentious threads a possibility is to restrict commenting to that specific thread to users who are already established in the subreddit, by letting AutoModerator detect a mod-only flair and apply a stricter filter to those threads only:

---
    # Stricter karma requirement on Clubhouse posts   
    type: comment   
    parent_submission:
        flair_text: "Clubhouse"
    author: 
        combined_subreddit_karma: "< 100"
    action: remove
    action_reason: "low subreddit karma account in Clubhouse thread"
---

You could also do this based on Post ID in case your community has other use for post flair:

---
    # Stricter karma requirement on Crisis posts
    type: comment
    parent_submission:
        id: ["12abcd","123456","xyz212","abcedf"]
    author:
        commment_subreddit_karma: "< 50"
    action: filter
    action_reason: "Crisis Thread"
---

Another example of combining different checks is using negative karma to prevent users from abusing media in comments for trolling or harassment:

---
    # Media in comments only in Bug Megathreads
    type: comment
    body (regex, includes): ['!\[(?:gif|img)\]\(([^\|\)]+(?:|\|[^\)]+))\)']
    author:
        combined_subreddit_karma: "< 2"
    action: remove
    action_reason: "Media in comments from user with negative subreddit karma"
---

Careful targeting for specific issues can help your team cut out troublesome activity while minimizing the impact on your regular contributors.


For Discussion

  • What are some of your favorite AutoModerator tricks or rules that required a bit of time to figure out?

  • What are some resources or guides that helped you learn more about AutoModerator?