Rules

Rules can be used to automate the moderation of comments. Go to Console → Settings → Rules to manage rules of your website.

How rules work

This of rules as a if condition.

If something (type) matches a given value, an action will take place.

Types

Hyvor Talk has the following rule types:

Type
Value
Description
Executed on
Comment word matches
string
Checks if words in the comment matches
Comment create/edit
Comment link domain matches
string
Checks if the domain name of any of the links in the comment matches
Comment create/edit
User name matches
string
Checks if the user's display name or user name matches
Comment create/edit
Comment link count exceeds
number
Checks if the number of links in the comment is greater than
Comment create/edit
Flags exceeds
number
Checks if the number of flags of the comment is greater than
Comment flag
Downvotes exceeds
number
Checks if the number of downvotes of the comment is greater than
Comment vote
Upvotes exceeds
number
Checks if the number of upvotes of the comment is greater than
Comment vote

Value

A value is given by you to match with the data of that type. If the match is successful, the given action will be executed.

All the numerical values should be equal to or greater than 0.

String values allow you to define multiple comma-separated values. Each value can contain any valid PCRE regex. However, if you use regex, limit it to basic regex, such as *, ., and [0-9], to avoid conflicts. String matching is case-insensitive. Examples:

  • hello - matches if the value is hello
  • hel.* - matches if the comment contains a word that starts with hel
  • hello,hi - matches if the comment contains the word hello or hi
Note: Currently, it is only possible to match single words with the string type. For example, it is not possible to match "hello world" together.

Action

There are 4 actions for each type.

  1. Keep pending
  2. Mark as spam
  3. Delete
  4. Publish

See moderation docs to learn more about comment statuses.

Priority

Rules are executed on each comment based on the priority. High priority rules will be executed first. If a rule is matched and the action is called, the other rules are ignored.

Examples

Here are some common use cases of moderation rules.

  • To keep a comment pending for moderation when it contains one or more links
    • Type: Comment link count exceeds
    • Value: 0
    • Action: Keep pending for moderation
  • To automatically delete a comment when it gets more than 5 flags
    • Type: Flags exceeds
    • Value: 5
    • Action: Delete

Monitoring

When a comment matches a rule, we keep a record of it. You can see these in Console Comments section along with each comment.

Comment history with rules