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]/empty Trash?X-Plex-Token=[PlexToken]

Parameters

NameDescription
IP addressThe IP address of the Plex Media server.
PlexTokenThe temporary authentication Plex token.
Library IDThe key associated with a library. This key can be found by calling the Libraries API command.

Return Status

HTTP CodeDescription
200Success - The request was successful.
401Unauthorized - 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
Subscribe

If you would like to keep up to date on the articles, API commands, or blog posts that are published, feel free to subscribe.