Skip to content

Menu: Expunge

ChuckPa edited this page Oct 16, 2026 · 1 revision
  • EXPUnge - (Option 22): Remove View History of Non-existent or Expired Accounts
    • Overview: Removes view history and statistics left behind by accounts which no longer exist in Plex, or which have been inactive longer than an age threshold. The threshold defaults to 180 days and can be changed with --expungeage N (or the DBREPAIR_EXPUNGEAGE environment variable), up to a maximum of 3000 days (see Command line options). Before anything is removed, Expunge prints a report listing each account (name or account ID), its last-active date, and the days inactive. When complete, it prints the total number of accounts removed.

    • Availability: Runs only when Plex Media Server is stopped. Requires enough free disk space for the working copies. Runs a check first and refuses if either database is damaged (run Repair first), unless the --force option is given.

    • Technical quirks & behavior: The account owner (account ID 1) is never removed. Interactively, Expunge shows the report and asks Ok to delete these users (y/N) before deleting. When run from the command line (batch mode), it deletes without asking. Up to 100 accounts are considered in one run. If no account qualifies, Expunge says so and changes nothing.

    • Safety status: Caution — Removed history cannot be recovered except with Revert. Works on copies of the databases; the result is promoted to active only after both databases pass an integrity check, is recorded in History, and can be undone with Revert.


Back

Clone this wiki locally