How to remove deleted files from your iTunes library

I use a little tool to manage my MP3s called “MP3 tag tools“. It’s quite powerful, it allows you to mass edit some or all ID3 tag fields, fill them from a file name scheme and vice versa (create folder structures and/or file names from the ID3 tag fields). Now when I recently cleaned up my collection using that tool, I noticed that I had about 400 double entries. I just didn’t notice before because the file names were different. Now as this tool tried to rename the files and put them in the appropiate subfolders, it threw error messages that existing files can’t be overwritten.

So I had 400 files that I could safely delete, which I did. Now I had 400 dead entries in the iTunes library (marked with a !) which I wanted to get rid of easily. Apparently, iTunes does not have a function to remove dead/broken/orphaned entries, I’d have to try to play every song from my playlist so iTunes would mark all missing entries and then… then what? iTunes doesn’t even let me sort by the ! column. That’s really stupid.

There is a solution though:

  1. Create a smart playlist with the criterion “Artist” is not “xxxyyyzzz” (or some other random string that does not occur as artist in your mp3 collection). Then name this smart playlist “all entries”. This way, we get a smart playlist with all database entries, working and broken.
  2. Create a static playlist called “working entries”.
  3. Open the “all entries” playlist, select all (ctrl-a/option-a) and drag the selection to the “working entries” playlist. iTunes will not copy dead entries, so now we have a list with everything and another with only the working ones. We need to substract them from each other. This is how:
  4. Create a smart playlist with the following criteria: “Playlist” is “all entries”, “Playlist” is not “working entries”. Check that all rules apply, not any rule. And dang! We just created a playlist of broken database entries. In this playlist, select all (ctrl-a/cmd-a) and hit shift-delete (alt-backspace on macs). iTunes will ask you if you want to remove the selected items from the iTunes library. Of course you want to!

Another way would be to deleteĀ My Music\iTunes\iTunes Music Library.xml and have iTunes re-import all the songs, but that would delete all the other information too, like number of skips, rating etc. so better not do it.

90 Comments

  1. Brilliant! Having had a double import of music from my other library, I had to get rid of loads of broken links. This is a god send!

  2. You just saved the world! It worked well but my edited IDv3 tags were not updating hence I deleted the entire library and then reimported everything.

  3. great post. I didn’t do it exactly like this but it made me think logically.
    Deleting the xml file didnt work, so I highlighted my entire library, deleted them but clicked “keep files” then just imported the entire live library back in. probably not the best but it works

  4. Thanks for this … just cleared out 1608 dead links that have been irritating me for AWHILE.

  5. Hey, Thanks. It worked, but I don’t know how you had the patience to wrestle through all the limitations of iTunes to figure it out.

  6. Thanks, this has been bugging me for along time. Worked perfectly, 408 songs GONE!

  7. Thanks for an incredibly useful tip.

    One comment – even on my (very fast) PC, it takes a VERY long time to drag the song titles from All Entries to Working Entries – though I do have over 114,000 songs on my PC. Just sit and wait, and eventually the mouse pointer will change to a “+”.

    Also, in your initial blog you said that you’d have to try to play every song to see which links are broken – you can now just Select All and then Untick Selection (or Tick selection).

    One other possibility, for those people where (for whatever reason) this doesn’t work: Use a field that doesn’t matter to you (perhaps BPM). Select all your tracks, and then use Right-Click Get Info. Set the BPM (or whatever) to 999. If you then sort by BPM, all the broken links will be at the bottom of the list and you can delete them.

    1. Thanks for these additional tips! I haven’t tried them, but they do sound promising and even easier than my method.

  8. Thank you! Makes me hate iTunes a little more. =) Glad that someone found a workaround!

  9. Dude, totally awesome. Worked like a charm after a re-organisation of my iTunes library. THANK YOU!
    (This should be in the iTunes help files!)

  10. Brilliant!
    They want a longer comment. So I’ll add that this was easy and cleaned up a bunch of garbage links. No muss, no fuss.

Leave a Reply

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