# Spam account scanner script

**URL:** https://meta.discourse.org/t/spam-account-scanner-script/128948
**Category:** Extras
**Created:** [September 18, 2019, 8:11pm UTC](https://meta.discourse.org/t/spam-account-scanner-script/128948 "2019-09-18T20:11:02Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![tannerfilip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tannerfilip/32/122253_2.png) [@tannerfilip](https://meta.discourse.org/u/tannerfilip)
#### Post date: [September 18, 2019, 8:11pm UTC](https://meta.discourse.org/t/spam-account-scanner-script/128948/1 "2019-09-18T20:11:02Z")

</div>

[https://github.com/TannerFilip/discourse-spam-check](https://github.com/TannerFilip/discourse-spam-check)

I’ll start off by saying, I’m not a great programmer. This is the first “real” tool I’ve written that’s (potentially) useful to people other than me. I’d love any feedback/criticism you have.

I’ve written a Python script that scans through the list of suspect and/or silenced users and lets you delete them if necessary. I ran it over on Mozilla’s Discourse and deleted a few dozen accounts - this was only after I deleted close to a hundred by hand.

There are a few things that seem pretty hacky, especially [lines 174 to 191](https://github.com/TannerFilip/discourse-spam-check/blob/master/main.py#L174). As I said, I’d appreciate any feedback you might have, and would be happy to answer any questions!

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [September 19, 2019, 12:05am UTC](https://meta.discourse.org/t/spam-account-scanner-script/128948/2 "2019-09-19T00:05:00Z")

</div>

Very cool! One thing you’ll want to do is be sure Akismet is enabled, as we recently (within the last 2-3 months) added a feature where the Akismet plugin will scan new user accounts for spammy stuff and flag them for you thanks to @Roman 👏

Yes, [completely human spam account signups](https://meta.discourse.org/t/chopped-spam-in-new-user-profiles/52804/4) – accounts that never post once, just set up an account with profile info and walk away forever – is indeed still a problem. The below is even _after_ Akismet checking:

 ![image](https://global.discourse-cdn.com/meta/original/3X/6/0/601046589262ab07db50d0280b2b57c425cbba7a.png)

But bear in mind user profiles aren’t indexed at all, and new user profiles have seriously suppressed info.. and our Akismet change helps tremendously.

Having a cleanup tool is still needed though!

---

<div class="post-metadata">

### Author: ![tannerfilip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tannerfilip/32/122253_2.png) [@tannerfilip](https://meta.discourse.org/u/tannerfilip)
#### Post date: [September 19, 2019, 1:29am UTC](https://meta.discourse.org/t/spam-account-scanner-script/128948/3 "2019-09-19T01:29:54Z")

</div>

> [@codinghorror](#):
>
> Akismet plugin will scan new user accounts for spammy stuff

I didn’t know that! I’ll have to talk to @LeoMcA to see if we want to enable that.

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [April 20, 2020, 6:04pm UTC](https://meta.discourse.org/t/spam-account-scanner-script/128948/5 "2020-04-20T18:04:46Z")

</div>

Suspect users are now being sent to the Review Queue, which removed the suspect users list this script was using. As they’re being pushed to manual review, is this needed now?

---

<div class="post-metadata">

### Author: ![Mine\_Zcash](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mine_zcash/32/110575_2.png) [@Mine\_Zcash](https://meta.discourse.org/u/Mine_Zcash)
#### Post date: [August 26, 2025, 3:50pm UTC](https://meta.discourse.org/t/spam-account-scanner-script/128948/6 "2025-08-26T15:50:54Z")

</div>

> [@codinghorror](#):
>
> Having a cleanup tool is still needed though!

Has there been any progress on this?

Our community is experiencing several spam/bot account signups per day that have 0 posts read, 0 topics viewed, less than 1min read time. It would be good to have an auto-remove function for all accounts with certain selected parameters.

Also, is there an option for a Captcha or similar plugin to help filter bots?

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [August 27, 2025, 1:52pm UTC](https://meta.discourse.org/t/spam-account-scanner-script/128948/7 "2025-08-27T13:52:02Z")

</div>

> [@Mine\_Zcash](#):
>
> Our community is experiencing several spam/bot account signups per day that have 0 posts read, 0 topics viewed, less than 1min read time. It would be good to have an auto-remove function for all accounts with certain selected parameters.

If those accounts have no activity, they’re harmless. They are invisible to other users (including a public user list). And user profiles, regardless of their trust level, are disallowed in robots.txt and not visible in search engines.

Plus, inactive accounts are periodically cleaned up, see **Clean up inactive users after days** setting (“Number of days before an inactive user (trust level 0 without any posts) is removed. To disable clean up set to 0.”).

It’s triggered by the **CleanUpInactiveUsers** SideKiq job.

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [August 27, 2025, 2:54pm UTC](https://meta.discourse.org/t/spam-account-scanner-script/128948/8 "2025-08-27T14:54:56Z")

</div>

> [@Canapin](#):
>
> are disallowed in robots.txt

That disallows nothing. robots.txt is only a pollite suggestion, that at same time points to right direction.

---

<div class="post-metadata">

### Author: ![Mine\_Zcash](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mine_zcash/32/110575_2.png) [@Mine\_Zcash](https://meta.discourse.org/u/Mine_Zcash)
#### Post date: [August 27, 2025, 6:51pm UTC](https://meta.discourse.org/t/spam-account-scanner-script/128948/9 "2025-08-27T18:51:19Z")

</div>

It may be innocuous but in the past spammers have used these accounts to “age” thier profile before activating it knowing that we are keeping an eye on new accounts. Then suddenly an account from 3 months ago starts trying to link to whatever spam or DM users phishing attempts.

Personally I would like better tools to head those off before they become a problem rather than waiting. I would also help if we had stronger tools to prevent bots from signing up in the first place.

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [August 27, 2025, 7:14pm UTC](https://meta.discourse.org/t/spam-account-scanner-script/128948/10 "2025-08-27T19:14:38Z")

</div>

Sure, it can still be an issue sometimes. I experience a lot of spam but so far I have seen no spam accounts suddently posting after a long time.

If they posted spam, they would quickly be flagged by other users anyway.

And you can still drastically lower the duration after which an inactive account is deleted.
