Delete expired users automatically
-
Hi,
Is there a way to remove a temporary user automatically, once their account expires?
I realised that when your plugin creates a temporary account, it creates an actual WP user account in the backend. Which is totally fine. But once it expires, that account remains in the regular WP Users list, even though the user can’t actually login anymore. Which is a problem, because some plugins (and WP core) use WP Users table to send notifications to active admins (or other roles). And since those accounts are still in the list, notifications will be wrongly sent out to them, even if the account already expired. The plugin needs to clean up it’s expired users out of the WP Users list in order to avoid that.
NOTE: It would still be nice to be able to restore/extend expired accounts, but only from the Temporary Logins settings page. So perhaps you need to store the list of expired temporary users in the DB somewhere. That way WP Users will only contain active accounts, while you will still have the ability to restore old users again (which will then re-add them to the WP Users table).
Regards,
Alex
- The topic ‘Delete expired users automatically’ is closed to new replies.