Delete “dead” files (links) in iTunes library

Problem: some songs appear marked with the ‘!’ sign in my iTunes and I just want to get rid of them (in my case I know the original source was an external drive I’m not using anymore).

Ideas: I learned that /Users/username/Music/iTunes/iTunes Music Library.xml contains a list with all songs and their path, so eager to make it quick I planned to create a python script to modify this file till I realized there was  no need to program.


  • everything here is related to iTunes v 11.x  & on Mac OS
  1. If running, stop iTunes and reopen it pressing Option key (alt)
  2. A prompt will ask you to change iTunes library (if not you weren’t holding the right key)
  3. Choose the ‘create’ new library buttonAt this point you’ll have an iTunes empty version. No songs listed at all.
  4. Finally, go to File>Library>Import playlist and choose the .xml file I told you before (/Users/username/Music/iTunes/iTunes Music Library.xml ). This way you’ll import all the files except from those having unreachable links to disk (which turns to be exactly what I wanted)

Some useful links i checked before I came up with a solution:

apple suport

programming example (in case your need to do something more complex)


Leave a Reply

Your email address will not be published. Required fields are marked *