スパム対策のコツ

:bookmark: This documentation provides a comprehensive guide on preventing spam in Discourse forums, and includes information about various settings and tools designed to help maintain a spam-free community environment.

:person_raising_hand: Required user level: Administrator

On most forums spam is rare. However, if you’re having problems with spam on your site, Discourse comes with numerous tools to help you automatically prevent spam.

The following guide offers some recommendations on how you can help prevent spam, while still maintaining a positive and welcoming environment for your community.

Spam Detection with Discourse AI

AI Spam Detection is one of the best Discourse features for automated spam detection. Unlike other tools, it can automatically block users and posts based on preconfigured rules. AI Spam Detection is available to all users on Discourse hosting, and on self-hosted sites with an LLM configured.

Benefits of AI Spam Detection include:

  • Automation: No manual intervention is needed to block obvious spam.
  • Customizability: You can tailor it to your community’s unique requirements.
  • Scalability: Works well even when communities are under heavy spam attacks.
  • Broad compatibility: Free (on Discourse hosting) and budget-friendly LLMs like GPT-4, Claude 3.5, and Gemini Flash can handle spam detection effectively.

Setting up AI spam detection

:megaphone: This is now default turned on for Starter and Standard customers

Simply turn it on in Admin settings → plugins → AI → Spam Handling (details here).

By default it uses a prompt that Discourse has tailored for our sites, but you may add custom instructions specific to your site.

Example tailored prompt

:information_source: With Discourse AI you can also use the creative AI bot to generate tailored prompts that are specific to your site’s needs.

Default Trust Levels

The default trust level for new users on your site can be adjusted on the .../admin/site_settings/category/trust page, however, we recommend keeping the default trust level set to 0.

If you’ve modified the value of this setting, we strongly recommend changing it back to 0: new user, as changing this setting can put your site at serious risk for spam, due to the way that trust levels interact with Discourse’s spam related settings.

Spam Related Site Settings

:warning: Unless you are specifically having trouble with spam, we recommend keeping the following settings at their default values.

Discourse has several spam related site settings that you can access on your site’s .../admin/site_settings/category/spam page.

These settings can be adjusted to increase or decrease the sensitivity of spam detection, and the strictness of the consequences associated with posting spam.

The following are some of the more commonly adjusted spam related settings that have a notable impact on how spam is handled on a site.

The default values for all settings are shown below.

Hiding Posts

The hide post sensitivity and cooldown minutes after hiding posts settings control the likelihood that a flagged post will be automatically hidden by Discourse, and how long a user must wait before they can edit a flagged and hidden post.

Silencing New Users

Discourse has a num users to silence site setting, which will automatically silence a new user if they receive a certain number of spam flags.

By default this is set to 3, so you may want to consider lowering this if you’re consistently having problems with spam coming from the same user(s).

Limiting Links

Discourse limits the number of posts a new user can make that contain links to an outside domain with the newuser spam host threshold setting. If new users on your site are frequently spamming links to the same domain, you may want to consider lowering the value of this setting.

Limiting IP Addresses

Discourse limits the number of new accounts a user can make from any given IP address. If you’re finding that problematic users on your site are repeatedly creating accounts to spam your site, you could consider lowering this from the default value.

There’s also a flag sockpuppets checkbox that you can enable to prevent users from creating multiple accounts and then commenting on the same topic:

Additionally, you can manually look up the IP addresses of problematic users on their admin page under the Last IP Address and Registration IP Address fields, and delete other accounts associated with the same IP address.

Or consider blocking IP addresses that spammers are using on the “Logs → Screened IPs” page (.../admin/logs/screened_ip_addresses):

Adjusting Flag Requirements

By default, a topic needs to be flagged by 5 unique users before Discourse will automatically suspending posting to that topic.

You can adjust the num flaggers to close topic site setting to raise or lower the number of flaggers required to suspend posting on a topic, and adjust the auto close topic sensitivity setting to change the likelihood that the topic in question will get automatically closed instead.

Watched Words

Watched Words are another great feature for helping block or limit posts that contain words, phrases, or URL links that spammers might be repeatedly using.

Considering adding some “Blocked” or “Silence” Words to your site if you’re finding that spammers are frequently using the same types of text in their posts.

For a more advanced use of Watched Words, you could also consider Using Regex with Watched Words.

Increase Trust Level Requirements

If you’re finding that spam is coming mainly from TL0 users, you may also want to adjust some of the trust level settings to make it harder to get to TL1:

hCaptcha Plugin

The Discourse hCaptcha plugin aims to enhance security and bot protection by integrating hCaptcha into the local sign-up form.

:sparkles: On all Discourse hosted sites, this plugin is automatically included.

Additional Steps

It’s important to understand why users are spamming your site. Are they’re bored, malicious, or looking to promote themselves?

Suggestions for dealing with The Difficult User, along with a variety of other moderation topics can be found in our Discourse Moderation Guide, so you may want to read through this guide for some additional ideas regarding moderating your site.

Outside of the above, ramping up your moderation team for the short term, so that you have full coverage is another good approach to combatting spam. The key is to wear the problem users down so they get bored and move on.

If you’re continually having problems with spam after going through this guide, you could also consider placing all or some posts from new users into the review queue with the approve post count, approve unless trust level, or approve new topics unless trust level settings:

However, it’s important to make sure you have enough moderators at hand to handle this, as this can have the potential make it difficult for new users to start interacting with the site if posts go unapproved.

Last edited by @Saif 2025-03-13T15:11:05Z

Check documentPerform check on document:
「いいね!」 17

すべてのフォーラムについて話すことはできませんが、私が以前TL3だったフォーラムでは、その日の最初に監視カテゴリにログインしたときに、少なくとも1つのスパム投稿がまだありました。そして、私が現在モデレーターを務めているフォーラムでは、1日あたり平均2件程度のスパム投稿があります。そのため、それに基づいて多くのフォーラムでスパムがある程度一般的だと思います。

「いいね!」 5

非常に便利な正規表現の1つは \\d{3}-\\d{4}|[\\w+\\-.]+@[a-z\\d\\-]+(\\.[a-z\\d\\-]+)*\\.[a-z]+ で、これは電子メールアドレスと電話番号をブロックします。設定 - posting - 「watched words regular expressions」を有効にすることを忘れないでください。

「いいね!」 7

こんにちは :wave:

フォーラムでこれらのヒントを大いに活用させていただいています。ありがとうございます!:heart:

たとえば gmail.com ドメインからサインアップする新規ユーザーのみをレビューキューに送信する設定を有効にすることはできますか?

現在、すべての新規ユーザーをレビューキューに送信していますが、スパムユーザーの大多数が Gmail メールを使用して作成されていることがわかりました。それらのみをレビューキューに送信することで、少なくとも私にとっては負荷とレビュー時間を削減できます :sweat_smile:

「いいね!」 1

@SaraDev これが可能かどうかご存知ですか?IPだけでなく特定のドメインもブロックできると非常に役立つので、私も知りたいです!

「いいね!」 1

特定のドメイン(例:gmail.com)からの投稿のみをレビューキューに送信するコアなDiscourse機能はありません。

最も近い関連機能は、auto approve email domains(メールドメインの自動承認)サイト設定で、特定のメールドメインからのユーザーを自動的に承認することで、手動のユーザー承認プロセスをバイパスできます。

また、blocked email domains(ブロックされたメールドメイン)およびallowed email domains(許可されたメールドメイン)の設定もあり、メールドメインに基づいてサイトに登録できるユーザーを制限または制御する方法を提供します。

ただし、これらの設定はすべてmust approve users(ユーザーを承認する必要がある)設定が有効になっている必要があり、サイトに最初に登録するユーザーにのみ影響し、投稿の作成とレビューキュー間のやり取りには影響しません。

回避策として、Groups(グループ)を使用して同様の機能を実現できます。たとえば、カスタムグループを作成し、特定のメールアドレスで登録したユーザーを自動的にグループに追加し、このグループをapprove unless allowed groups(許可されたグループ以外は承認)およびapprove new topics unless allowed groups(許可されたグループ以外は新しいトピックを承認)設定に追加することができます。

このタイプのセットアップにより、必要に応じて他の投稿をレビューキューに送信したまま、特定のドメインを持つユーザーのレビューキューを効果的にバイパスできます。

「いいね!」 2

こんにちは、トピックや投稿の作成時にCAPTCHAを強制することは可能でしょうか?

わかりませんが、ボットがログイン時にキャプチャをバイパスできると、公開時にも同じことができるということでしょうか?

確かに、登録にはCAPTCHAサポートがあるようですが、トピック/投稿の作成にも同様のものが存在するかどうか疑問に思っていました。

最近、多くのクライアントが大規模なスパム攻撃を受けており、それらに共通していたのは、create のカテゴリを everyone に開放していたことです。これにより、すべての信頼レベルの制限がバイパスされていました。

経験豊富な Discourse 管理者にとっては明白なことですが、経験の浅い人々にとってはそうではありません。そのため、私たちにとって明白なことを明記し、トピックの最初の投稿に追加するのが良いかもしれません。

「いいね!」 7

最近、自動登録を利用して、あたかもアドバイスを求める正規のリクエストのように見せかけながら、Amazonアソシエイトリンクを含んだAI生成コンテンツで新しいトピックを作成するスパマーに対処しています。彼らは通常、さまざまなURL短縮エンジンでそれらのリンクを隠しています。彼らは返信に対応でき、さらには面白い方法でプライベートメッセージでチャットすることもできます。誰かこのような経験をしたことがありますか?これらの試みは完全に自動化されているように見えるため、他の多くのターゲットとなるDiscourseフォーラムがあるのではないかと思います。彼らを切り捨てるための戦略について何かアドバイスはありますか?

「いいね!」 1

こんにちは @Overgrow

これを防ぐために試せるアイデアをいくつかご紹介します。

  • Discourse AI - AI triage を使用して、コミュニティでスパム検出を設定し、この種のコンテンツを検出します。
  • URL短縮サービスやAmazonアフィリエイトリンクのパターンを、ブロックする watched words リストに追加します。
  • newuser spam host threshold を下げ、TL1 の要件を増やします。
  • max new accounts per registration IP を減らし、flag sockpuppets を有効にします。
  • Discourse hCaptcha プラグインを使用して、サイトでの自動スパム/AI登録を防ぎます。
  • 攻撃が収まるまで、すべての新規ユーザーコンテンツをレビューキューに配置することを検討します。以下の設定を調整してください。
    • approve post count
    • approve unless trust level
    • approve new topics unless trust level

ここでのアプローチは、一般的なスパム防止と同様ですが、特に短縮URLとAI生成コンテンツに焦点を当てます。

今回のケースでは、以下のようなAIコンテンツを特定するためのAIプロンプトを使用できます。

あなたはスパム検出システムです。以下のコンテンツとコンテキストを分析してください。

注:
- 返信は、ディスカッションスレッドに関連性を保ってください。
- コンテンツが無関係、宣伝目的、または自動化されている場合は、SPAMとしてマークしてください。
- リンクを含む新規ユーザーの投稿は、トピックに明示的に関連していない限り、潜在的なSPAMと見なしてください。

本物のように見えるが、不自然なパターンを持つコンテンツに注意してください。
奇妙な言い回し、過度にフォーマルな言葉遣いとカジュアルな言葉遣いの混在、または文脈に合わない一般的なアドバイスを探してください。
アフィリエイトリンクを隠しているコンテンツ、特に製品推奨に自然に誘導するように設計されているように見える投稿にフラグを立ててください。

これらのレッドフラグに特に注意してください:
1. 正規のアドバイス要求を装っているが、宣伝要素が含まれているコンテンツ
2. 問題を提示し、特定の製品を解決策として提案する投稿
3. アフィリエイトリンクを偽装する可能性のあるURL短縮サービス(bit.ly、tinyurl、t.co、goo.glなど)の存在
4. Amazonの製品リンクまたは参照、特にアフィリエイトパラメータ(tag=、ref=、affiliate=)が付いているもの
5. 推奨を求めているように見えるが、巧妙に特定の製品に誘導するコンテンツ
6. 人工的な品質のテキスト - 過度にフォーマルな言葉遣いとカジュアルな表現または不 awkward な構造の混在
7. 上記のパターンのいずれかを持つコンテンツを投稿する新規アカウント

「SPAM」または「NOT SPAM」のみで応答してください。
「いいね!」 3

最近、ボットアカウントに非常に悩まされています。2度目の新規ユーザー登録無効化が必要になりました。昨日、約30件のスパム投稿をしたボットアカウントを50件以上削除しなければなりませんでした。すでに難解なパズル付きのhcaptchaを有効にしましたが、それでも止まりません。3.5.0を使用していましたが、攻撃直後に3.6.0にアップデートしました。すでにトラストレベル0ではリンクを許可せず、リンクを許可するには30件の投稿が必要ですが、これらの投稿は旅行代理店に関する長文やその他の無意味な内容ばかりです。AIアカウントや、実際のフォーラムコンテンツを参照しているものの、意味が通じない投稿もありました。これらはユーザーベースにとって多少面白いものですが、とにかく、フォーラムでAIを有効にしたくはありませんでしたが、他のすべての選択肢を使い果たしたと感じています。しかし、このメッセージが表示されます。

しかし、その設定を追加する場所が見当たりません。

何よりも、AIはスパムの助けになるかもしれませんが、そもそもボットアカウントが作成されるのを防ぐのに役立つとは思いませんが、それは間違っていますか?

「いいね!」 1

approve post count が 1 に設定されている場合、これらを変更する必要はありますか?

正直なところ、その質問の答えはわかりません。