Inactive Users helps you manage accounts that have not been used for an extended period. It identifies inactive users, sends email warnings, and can block or cancel accounts that remain inactive after a configurable grace period. This helps keep your user list manageable, reduces the risks associated with abandoned accounts, and supports your site's data-retention policies.
You stay in control. By default, the module only reports inactive accounts. Viewing the list does not send emails, block accounts, or delete users. These actions happen only when you initiate them or explicitly enable automatic processing.
Features
- Inactive account overview: View accounts under People » Inactive users, including their last login, account creation date, warning date, and action date. Filter the list by status:
- All inactive accounts.
- Not yet warned.
- Warned and still within the grace period.
- Due for action.
- Configurable inactivity period: Choose how many days an account can remain without a login before it is considered inactive. Accounts that have never logged in are assessed from their creation date, helping avoid treating newly created accounts as immediately inactive.
- Account protection: The user 1 account, selected roles (administrators by default), and individually exempted accounts are excluded from warnings, blocking, and cancellation. Exempt individual accounts directly from their user edit forms.
- Customisable warning emails: Configure the email subject and message, using placeholders for the user's name, login deadline, and planned action. Emails are sent in the user's language and can be translated.
- Configurable grace period: Give users a specified number of days to log in after receiving a warning. Logging in during this period ends the warning process for that account.
- Flexible actions: Choose what happens when an account remains inactive after the grace period:
- Take no action and keep the account on the report.
- Block the account.
- Block the account and unpublish its content.
- Delete the account and reassign its content to the anonymous user.
- Delete the account and its content.
- Bulk operations: Select individual accounts or all accounts to send warnings, clear warning records, grant exemptions, block accounts, or apply the configured action immediately. Blocking and account cancellation require confirmation.
- Optional automation: Let cron send warnings and process inactive accounts automatically, with a configurable limit on the number of accounts processed per run. Automatic account deletion requires automatic warnings to be enabled, ensuring users receive warnings before deletion.
- CSV export: Export the inactive account list for reporting and record-keeping.
- Drush integration: List inactive accounts, send warnings, and process accounts from the command line, with support for dry runs.
- Activity logging: Record every warning and account action in the Drupal log for auditing and troubleshooting.
Requirements
- Drupal 10.3 or later, including Drupal 11.
- A working mail system to deliver warning emails.
Installation
Install the module as you would any other contributed Drupal module. For details, see the Drupal module installation guide.
composer require drupal/inactive_users drush pm:enable inactive_users
Configuration
- Grant the Administer inactive users permission to the roles responsible for managing user accounts.
- Go to Configuration » People » Inactive users (
/admin/config/people/inactive-users) and configure:- The number of days without a login before an account is considered inactive (180 days by default).
- The roles to exclude from inactivity checks.
- The grace period users receive after a warning (7 days by default).
- The action to take when the grace period expires.
- Whether warnings and account actions should run automatically through cron.
- The warning email subject and message.
The warning email supports the following placeholders:
[user:display-name]— the user's display name.[user:account-name]— the user's account name.[site:name]— the site name.[site:login-url]— the login URL.[inactive-users:days]— the configured inactivity period.[inactive-users:deadline]— the last day to log in before the grace period expires.[inactive-users:action]— the action scheduled if the user remains inactive.
Usage
- Go to People » Inactive users to review accounts that meet the inactivity criteria.
- Select the accounts to warn and choose Send the warning email, or enable automatic warnings through cron.
- After the grace period expires, review accounts in the Due for action filter. Apply the configured action manually or let cron process the accounts automatically if automation is enabled.
Upgrading from 1.0
After updating the module, run the database updates:
drush updatedb
- Safer default behaviour: Version 1.0 could delete warned accounts when the inactive user list was viewed seven days after a warning. The new version no longer performs actions when the list is viewed. The configured action defaults to Nothing until you choose otherwise.
- Existing warnings are preserved: Previously sent warning records are retained, and the Inactive Warning Sent field is removed from user accounts.
- Updated permissions and exemptions: Administrators are exempt from inactivity actions, and roles that previously had permission to administer users receive the new Administer inactive users permission.
Support
Report bugs, suggest improvements, or request new features through the Inactive Users issue queue.
Project information
Minimally maintained
Maintainers monitor issues, but fast responses are not guaranteed.Maintenance fixes only
Considered feature-complete by its maintainers.33 sites report using this module
- Created by chaitanyadessai on , updated
Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.