Discourse deleting users

AI-generated summary

Discourse Deleting Users

The discussion revolves around the automatic deletion of inactive users in Discourse. Henry_Cooper wants to turn off this feature as it affects his email marketing. However, codinghorror points out that inactive users don’t have valid, confirmed emails, making it unnecessary to keep them.

oamarfilip suggests that the purge unactivated users grace period days setting can be set to 0 to prevent unactivated users from being deleted. TheBestPessimist asks about inactive users created via SSO, and codinghorror explains that it’s not possible to generate inactive users via SSO.

bts shares an exception where using WP Discourse for SSO can create inactive users, and the auto-deletion of these users might be justified. However, bts also wonders if a user who returns later can still activate a Discourse account with the same username after being auto-purged.

It appears that the automatic deletion of inactive users is intended to prevent spam and ensure email validation. While it’s possible to disable this feature, it’s essential to consider the implications of keeping inactive users with unverified emails.

I checked my logs and notices that users were being deleted because they were inactive.

Is there any way I can turn this setting off?
The only reason i want to do this is because I export the emails of all my users and use it for email marketing my blogs.

Alternatively, if anyone knows a query which will let me get a list of all the deleted users and their emails, that would be extremely helpful!

Thanks in advance.

Are those users who never activated their accounts?

There is a setting for them: purge unactivated users grace period days

“Grace period (in days) before a user who has not activated their account is deleted. Set to 0 to never purge unactivated users.”

Inactive users don’t have valid, confirmed emails, so your request makes no sense. I could sign up with ronald.mcdonald@mcdonalds.com and .. you’d send marketing email to that address?

What about inactive users which are created via sso? are those going to be deleted as well?

It’s not possible to generate inactive users via SSO. The parent site is authoritative, and vets the emails.

Then this


is unrelated?

Are you asking me if you have created broken SSO? It’s possible, yes (especially if you indicate that the parent site has validated email, but in fact does not. This is extraordinarily dangerous since any user can sign up as any email address in the system.). Should you create broken SSO? No.

I will have to check that. Thanks for the hint tho :slight_smile:

This may not always be the case at least when it comes to using WP Discourse for SSO.

We’re using WP Discourse + WooCommerce for subscription / membership signups, and I see in our logs we have many Discourse users being auto-deleted by system. We add new WP subscribers to a custom Discourse group using add_user_to_discourse_group in WP Discourse, which as I understand it creates the user, but inactive / pending email verification in Discourse.

Sounds like this can happen with WordPress whenever you’re using a signup flow that’s different from the WP default (for example with Woo or a membership plugin), and therefore still requires email validation on the Discourse end as mentioned here: Auto activated accounts for WP Discourse SSO?

In this case this behavior (auto-purge inactive users) seems okay, as it represents people who signed up on the WP site but never got around to using Discourse. Just thinking through this further…I assume when an inactive account is automatically purged, if that user comes back later they will still be able to activate a Discourse account with the same username? Hope that’s how it works anyway!