Apple - How do I remove files from iTunes which have been deleted on disk?

I've found the easiest most reliable solution yet! No scripts, no loss of playcounts/ratings etc.

  1. Create a new playlist, say temp.
  2. Select all your the tracks you want to deal with and drag and drop them to the playlist. The new playlist will only contain valid tracks. All invalid tracks will be marked with the exclamation mark.
  3. Switch to the playlist and select all the tracks, then right-click and Uncheck Selection
  4. Switch back to Music and sort by the checkmark - now all the invalid tracks are grouped together!
  5. Select them all and delete!

You can then go and Check the songs again to make sure they get synced to devices.


For adding functions to iTunes you should look at Doug;s Applescripts. There is a script to remove dead tracks.


A roundabout way is longer, but doesn't need any scripts.

  1. Export your library to the desktop as an xml
  2. quit iTunes and move these files to the desktop / trash

    • iTunes Music Library.xml
    • iTunes Library.itl
    • iTunes Library Extras.itdb
    • iTunes Library Genius.itdb
  3. Start iTunes - it will look "empty" but all your programs and music are still around

  4. Drag the iTunes Media folder into your iTunes window - Library on the top left - drop the folder over Music or the other categories and iTunes will re-add them to the database, but only the files that exist still on the drive will be added
  5. Import the saved library.xml file - this will add back all the ratings, playlists, and songs that no longer exist will be cleaned out of the playlists

Tags:

Itunes