On this page
Expiring user accounts on a specific date
Last updated on
4 February 2025
Configuration Instructions:
-
Install and Enable the Module:
- Ensure that the User Expire module is installed and enabled on your Drupal site.
-
Ensure Proper Permissions:
- Confirm that you (or the administrator) have the “set user expiration” permission. This permission enables the expiration settings to appear on user edit forms.
-
Access the User Edit Form:
- Navigate to the edit page for the user account you wish to set an expiration date on. This is typically done by going to the user’s profile and clicking “Edit.”
-
Locate the User Expiration Section:
- On the edit form, scroll to the User Expiration fieldset. This section is automatically added by the module when you have the appropriate permissions.
-
Enable and Set the Expiration Date:
- Check the “Set expiration for this user” checkbox.
- A container with a datetime field will appear. Use this field to select the expiration date. The field uses Drupal’s datetime widget (displaying the date in a
Y-m-dformat) to ensure proper input. - Note: The expiration date you choose will determine when the account is disabled.
-
Submit the Form:
- After setting the desired expiration date, save the user account by submitting the form.
- The module saves this date in its own database table, linking it to the user’s account.
-
How Expiration is Processed:
- During Drupal’s cron runs, the module checks the stored expiration dates.
- If a user’s expiration date has passed (or matches the current date), the module will automatically block the account—preventing further login or interaction.
- Additionally, the module may notify users about their upcoming expiration if warning emails are configured.
-
Review and Testing:
- After configuring an expiration date, test the process by verifying that the expiration is applied as expected (for example, by simulating a cron run or checking the account’s status after the set date).
-
Additional Information:
- For more details on setting up and troubleshooting cron (which triggers the expiration process), please refer to Drupal’s Cron Documentation.
By following these instructions, you can easily configure individual user accounts to expire on or after a specific date, ensuring that your site maintains control over inactive or time-sensitive user accounts.
Help improve this page
Page status: No known problems
You can:
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion
Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.