How to Clean Bundles

If you have been managing a Plex server for several years then you may have removed items from your library from time to time. For those items that have been deleted, Plex won't automatically remove the associated poster images and other metadata files from the server.

Cleaning the bundles 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 cleaning bundles on your Plex server.

How to Clean Bundles in Plex

Table of contents

How to clean bundles
The step-by-step guide for running the clean bundles option from the Plex Web app.
Using the troubleshooting option
These steps explain how to use the clean bundles option found in the troubleshooting section of Plex.
Scheduling clean bundles in Plex
Step-by-step instructions for scheduling the clean bundles command to run on a schedule in Plex.
Running clean bundles on-demand
Discusses how you can run the clean bundles command at any time without using the Plex Web app.

How to clean bundles

When Plex associates images and metadata files with your media items, these files are stored in "bundles" on your Plex server. When a media item is removed, the bundle associated with the item is not automatically removed.

Plex will clean bundles from your server as a weekly scheduled task. If you have removed many items, you may want to run the clean bundles option manually to free up space on your server.

Cleaning the bundles in Plex is usually quick and easy, depending on how many files need to be cleaned from the server. To clean the bundles 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->Clean Bundles from the menu that appears.
    The Clean Bundles Option in Plex.
    The 'Clean Bundles' Option in Plex
  3. Click the Clean button.
    The Clean Bundles Dialog in Plex.
    The 'Clean Bundles' Dialog in Plex

Using the troubleshooting option

You can also clean the bundles using the option under the troubleshooting section found in the Plex settings. Use the following steps to clean the bundles using this option.

  1. Log into your Plex server as an administrator, and then click the Settings - the wrench - link in the upper-right corner of the Plex server page.
    Plex Settings Icon.
    The 'Plex Settings' icon
  2. Scroll down the left menu and then click the Troubleshooting option under the Manage section.
    Plex Troubleshooting Option.
    The Plex 'Troubleshooting' option
  3. Click the Clean Bundles button and wait for it to complete.
    Using the Clean Bundles button in Plex's Troubleshooting section.
    Using the Clean Bundles button in Plex's Troubleshooting section
  4. Once completed, the message Bundles cleaned will appear beside the button.
    Cleaning the bundles in Plex is completed.
    Cleaning the bundle in Plex is completed

Once the above steps are run, the amount of drive space used by Plex should be reduced. The amount of space that is freed up is dependent on how many old bundles were removed.

The clean bundles command is run for the entire Plex server, meaning it will clean any unneeded media bundles for all libraries on the server. There is no option to run the clean bundles command for an individual library.

Scheduling clean bundles in Plex

Running the clean bundles option in Plex is a good way to free up space immediately after removing large media items, but you may want to remove old bundles on a regular basis. Plex allows you to schedule this task on a weekly basis.

To schedule the cleaning of old bundles, use the following steps:

  1. Log into your Plex server as an administrator, and then click the Settings - the wrench - link in the upper-right corner of the Plex server page.
    Plex Settings Icon.
    The 'Plex Settings' icon
  2. On the left menu, click the Scheduled Tasks option under the Settings section.
    Plex Scheduled Tasks Option.
    The Plex 'Scheduled Tasks' option
  3. Check the Remove old bundles every week option and then click the Save Changes button at the bottom of the page to save your changes.
    Remove old bundles every week option in Plex.
    The 'Remove old bundles every week' option in Plex

The above steps will have Plex clean old bundles on a weekly basis to help optimize your Plex server.

If needed, you can manually run the clean old bundles task using the Plex API.

Running clean bundles on-demand

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

The Plex scheduler outlined in the previous section will run the clean bundles command on a weekly basis. If you would like to clean up the bundles on a different schedule, then you can call the clean bundles API command from a third-party scheduler instead of using the built-in Plex scheduler.

When you run the clean bundles using the API, there is a parameter called async. This parameter is used to run the API command asynchronously.

When this parameter is set to 1, the response from the command will return immediately, but the clean bundles command will continue to run on the server.

If the async parameter is set to 0, then the response won't be returned until the clean bundles command has finished running on the server.

When running the clean bundles command from Plex, the async parameter will be set to 1. You may want to set this parameter to 0 when running the command on a schedule so that the job running the command will know when it has finished running on the server.

While you shouldn't need to clean the bundles from your Plex server very often, it is a good option to use if you have done a purge of many media items from your server to help free up space.

Subscribe
Display