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 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.

45 Responses to “How to remove deleted files from your iTunes library”
  1. gdog says:

    thanks! that helped a lot

  2. Will B. says:

    As of iTunes 9.2.1.5, I wasn’t able to “drag” the files from the smart playlist to the static playlist, but I was able to right click and do that. However, it still copied the missing file tracks.

  3. Dave says:

    Yes! It works. I lost a number of iTunes songs due to a dead external HDD. Stupid of me not to back them up, but that’s the way it is. I ended up with all sorts of (!) listings on my iTunes library that I wanted to clean up- this did it! Yes. :-)

  4. Annie Newton says:

    This was perfect. After doing the updates, I had a minor heart attack when I found that I had 353 less entries in my music than in my working entries…until I realized that the difference was because the remaining 353 were not music, but movies and TV shows. So everything was perfect. Your ideas was f=great…better than my original frustrated one…which was deleting 4566 entries manually. Thanks very much!

  5. Jay2k1 says:

    I’m glad to see that my post was helpful for a small bunch of people (and probably more who didn’t leave a comment). This alone makes me feel this blog is worth something :)

    Also thanks for sharing your experiences and tips.

    Jay

  6. Frank says:

    Great idea! I didn’t think of that

  7. Stephen says:

    Thanks so much for this solution. It took me all of 2 minutes to clean my list. Keep up the good work.

  8. rupin says:

    brilliant. saved me a whole lot of time

  9. B. says:

    Thanks man, I was going through them one by one. It’s soodumb that there isn’t an option to just remove them in itunes. Thanks again.

  10. Jane says:

    this is kind of a stupid question, but what exactly defines a “static playlist”

  11. JeffDaMan25 says:

    Thanks for your help, totally works! Love the “Live Updating” as well… brilliant!

  12. TeKola says:

    Genius! Thanks I have downloaded a lot of garbage to try and do this, but this works.

  13. Marty says:

    Thank you SO MUCH! After copying music from an iPod several times I would up with multiple copies of about 1000 songs. When I deleted the earlier attempt folders, I was left with 2 out of every 3 or 4 songs on my iTunes being unavailable. After working my fingers numb deleting them one or two at a time, I xsaid.. there must be a better way! Appreciate the help .. bu the way this is iTunes version 10.1 on Windows 7.

  14. Buckshoop says:

    Suberb – I was manually deleteing them when after an hour I got fed up and found your blog – you’ve saved me days! – I had over 20GB of deleted songs!!

  15. Bgas30 says:

    Brilliant. Thanks

  16. Karen H. says:

    Found this on a Google search and it worked perfectly. Thank you so much! You saved me hours and hours of time.

  17. michael says:

    perfect! Thanx!!!

  18. ramjet says:

    wow-worked perfectly. thanks mate!

  19. Paul C says:

    Great tip, thanks! Really helped me get my library back together!

  20. Abacus says:

    Good find. Thanks mate.

  21. gangsta yo says:

    works perfectly on current itunes 2011-i love you.

  22. Relieved says:

    I NOMINATE YOU FOR THE NOBEL PRIZE IN PHYSICS! Sometimes the best solutions are the simplest. Tried some Apple scripts and other useless time wasting ideas but this was by far the quickest, easiest and thus the best way to resolve this annoying problem. Thanks.

  23. DBNemesis says:

    Worked like a charm!

  24. Joel says:

    Had been manually selecting for 5 minutes and then hoped/knew many other people probably had the same problem at some point. Thanks for providing a simple yet elegant solution. Saved me a ton of time and certainly a headache!

  25. Kristin says:

    BEAUTIFUL. I’ve just started using iTunes (the iphone and purchasing music from itunes demands it) and I’m having trouble figuring out its little peculiarities compared to Windows Media Player. This was amazing! And now I don’t have to do this manually, for hours, til I die. Thanks!

  26. Spacemanspiff says:

    Actually I found it much easier to just delete all files from the library and then re-add the folders with the files you want.

  27. craig says:

    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.

  28. ran says:

    Genius; thanks so much.

  29. Jay2k1 says:

    @Spacemanspiff: Sure you can do that; you’ll lose ratings, play count and other library metadata though.

  30. ? says:

    Fukin sick guy!!

  31. Ashley says:

    Amazing! Thank you so much!!! This is exactly what I needed to do!

  32. Jamie says:

    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!)

  33. Big George says:

    Great idea. Worked like a charm.

  34. Rick says:

    Worked great! Makes me hate iTunes a little less…

  35. Jeremy says:

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

  36. BC says:

    thanks it worked great!!

  37. Philip says:

    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.

  38. Jerome says:

    Thanks mate 400 dead entry removed successfully

  39. Paulo says:

    Fantastic!
    Works like a charm.

  40. Adriaan says:

    Thanks! 853 broken files removed

  41. Jay2k1 says:

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

  42. Jim says:

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

  43. Warren says:

    Thanks, very useful and much appreciated!

  44. Sam says:

    You sir, are a genius. Thank you so much.

  45. Duck says:

    Excellent!
    Has annoyed me for years, much appreciated

  46.  
Leave a Reply