Note: You are currently viewing documentation for Moodle 3.6. Up-to-date documentation for the latest stable version of Moodle is likely available here: Inactive User Cleanup.

Inactive User Cleanup

From MoodleDocs


This plugin deletes inactive user accounts. The cleanup process runs with the Moodle cron.

The cleanup-process runs in two steps for each user. If an inactive user is found he gets a notification mail and is marked as notified within this plugin. When the user still has not accessed the system after a chosen timespan he will be deleted in the second step. When a notified user logs in again before the deletion process starts, his notify entry is removed with the next run of the cleanup process.

The process checks the last access time stamp of the user against the present time stamp. You can configure how often the process is started by a time interval in days.


  1. Make sure you have all the required versions.
  2. Download the User Cleanup plugin.
  3. Unzip it into your moodle/blocks/ directory.
  4. Login to you moodle as Administrator and go to Site administration -> Notifications to trigger the installation process.
  5. Turn editing on the home page.
  6. Add the block to the page.
  7. Follow the link in the block to the settings page and make your settings(Details described below).

For more information see Installing contributed modules or plugins.


The block can be included by the admin on the main page. The block offers a link to the plugin settings.

NOTE: The cleanup process itself runs in the moodle cron. So the moodle cron must be running to use this plugin. For more Information see Cron.


The settings for the cleanup process

Here you can activate or deactivate the cleanup cron process.
Interval to check
Set how often the process should start (days). If set to 0 or negative the process runs with every moodle cron.
Days of inactivity
The number of days since last login to mark the user as inactive and notify him by mail.
Days before deletion
The number of days after the notify mail until he gets deleted.

Mail Text

The mail text and any other texts of the plugin can be customized over the moodle Language customization.


eLeDia - E-Learning im Dialog GmbH


See Also


Modules & Plugins database entry


You can also find the code on Github.

NOTE: In Github we use an empty master branch. The different plugin versions can be found in special branches for each Moodle version.