Empty Trash
When you remove media files or directories from your server and perform a scan, Plex will typically remove the items from the media library. If you have disabled Plex from automatically emptying trash after each scan, then you will have orphan items in your Plex server.
You can manually empty the trash in Plex by using this API command.
This command is the same API command used by the Empty Trash option in Plex.
URL
PUT http://[IP address]:32400/library/sections/[Library ID]/emptyTrash&X-Plex-Token=[PlexToken]
Parameters
Name | Description |
---|---|
IP address | The IP address of the Plex Media server. |
PlexToken | The temporary authentication Plex token. |
Library ID | The key associated with a library. This key can be found by calling the Libraries API command. |
Return Status
HTTP Code | Description |
---|---|
200 | Success - The request was successful. |
401 | Unauthorized - The Plex token provided was not valid. |
Response
No response is returned. You will be able to see the empty trash API command run from the Plex console.
Remarks
The empty trash command will need to run for each library in your Plex server.
Examples
Example 1
Run the empty trash command for the library with ID 7 on a Plex server located at IP address of 192.168.1.4:
PUT http://192.168.1.4:32400/library/sections/7/emptyTrash?X-Plex-Token=L6vkd7JtLHjsH5987vYY