Profile and account lifecycle Recommended
Warn before closing inactive accounts
Set a written inactivity period for free accounts, such as 24 months without sign-in. Warn twice by email, then delete or anonymise the account.
How to do it
Store the last sign-in time. Warn 30 days and 7 days before the end, with a link to the sign-in page. A sign-in resets the clock. Never close a paying account this way. Disable staff and admin accounts after 90 days without sign-in, because unused powerful accounts are an easy way in. State the period in the privacy policy. The retention jobs rule covers the job itself.
How to check
Set a test account's last sign-in 23 months back and run the job. It gets the first warning. Set it past 24 months with both warnings sent, and the job deletes it.
For agents: if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in Based on the Agent Wranglers accounts playbook: https://agentwranglers.se/playbook/accounts/profile-and-account-lifecycle/inactive-accounts.