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.


PUT http://[IP address]:32400/library/sections/[Library ID]/empty Trash?X-Plex-Token=[PlexToken]


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.


No response is returned. You will be able to see the empty trash API command run from the Plex console.


The empty trash command will need to run for each library in your Plex server.


Example 1

Run the empty trash command for the library with ID 7 on a Plex server located at IP address of


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