How to Empty Trash

When you delete media files from your Plex server, the media item associated with those files will still be showing in Plex. This is because Plex doesn't delete information associated with deleted media immediately. To remove information for media files that have been deleted the empty trash command will need to be run.

Emptying the trash from your Plex server is one of the steps in the Plex Dance to reset a library on your server.

The next section explains the steps involved in emptying the trash on your Plex server.

How to Empty Trash in Plex

How to empty the trash

Plex stores information about all the media it manages on either the file system in a data directory or in the Plex database. Each time Plex scans a library, it downloads and stores the media metadata information.

When files associated with an item are deleted from the file system, Plex won't delete the metadata information immediately. The empty trash command will need to be run on the server to clean up any information that is no longer associated with a media item.

Emptying the trash in Plex is usually quick and easy, depending on how much information needs to be cleaned from the server. To empty the trash in Plex, do the following:

  1. From Plex, click the More link.
    The More Option in Plex.
    The 'More' Option in Plex
  2. Move your mouse cursor over your server name from the menu on left. Click the three dots that appear, and then select Manage Server->Empty from the menu that appears.
    The Empty Trash Option in Plex.
    The 'Empty Trash' Option in Plex
  3. Click the Empty button.
    The Empty Trash Dialog in Plex.
    The 'Empty Trash' Dialog in Plex

Once the above steps have been completed, any information for all deleted media files will be removed from Plex.

How to empty the trash for a library

Plex provides a way to empty the trash for a specific library. This option is available if you delete files that are associated with one library. By only emptying the trash for a library, you prevent Plex from accidentally deleting information for other libraries unnecessarily.

Emptying the trash for a single library is very similar to emptying the trash for the entire server. The following steps explain how to empty the trash for a single library:

  1. Move your mouse cursor over the library name from the menu on left. Click the three dots that appear, and then select Manage Server->Empty from the menu that appears.
    The Empty Trash for Library Option in Plex.
    The 'Empty Trash' for Library Option in Plex
  2. Click the Empty button.
    The Empty Trash Dialog in Plex.
    The 'Empty Trash' Dialog in Plex

Automatically emptying the trash in Plex

You can have Plex automatically run the empty trash command whenever it performs a scan on media items. This means that if Plex detects a media item in a library no longer has any files associated with it, the information for the media item is deleted.

I don't recommend you enable this option for one reason: Plex can accidentally delete information for media items that aren't really deleted.

What I mean by that is if you store the media files on a different device than your Plex server, such as a NAS or external hard drive, that device can become disconnected from the server. If Plex scans the libraries when the device is disconnected, then Plex will flag those media files from the disconnected device as deleted. Plex will then run the empty trash command, which will delete the information associated with the disconnected media items.

You will also want to disable this setting when you are migrating your Plex server to a new server.

If you wish to have Plex automatically run the empty trash command after every scan, then you can use the following steps:

  1. Open a Web browser and navigate to your Plex server.
  2. Log into your Plex server with an administrator account.
  3. Click the Settings icon - the wrench - in the upper-right corner of the Plex server page.
  4. On the left menu, click the Library option under the Settings section.
  5. Check the Empty trash automatically after every scan option.
  6. Click the Save Changes button at the bottom of the page to save your changes.
    Empty trash automatically after every scan option in Plex.
    The 'Empty trash automatically after every scan ' option in Plex

The above steps will have Plex empty the trash after it has performed a scan.

Running empty trash on-demand

When the empty trash option is run, whether from the Plex Web app or the scheduler, Plex calls its API command to empty the trash. You can also run the empty trash API command anytime to clean up your Plex server whenever you wish.

While it is good to periodically empty the trash on your Plex server to clean out old, unneeded data from Plex, you must be careful when you do run the command to avoid deleting too much information from Plex.

Subscribe
Display