I was trying to move my iTunes library from my dead laptop’s hard drive to my desktop PC and accidentally I ended up getting a lot of duplicate songs into my library. After Googling around for a duplicate file remover, I was able to physically remove those duplicate songs from my file system, but iTunes still listed those songs with a little exclamatory ("!") mark next to it. Even though iTunes can list duplicate tracks, it cannot sort the library by broken songs which it canâ€™t play. Manually clicking each song and removing it wasn’t an option for me as I had countless broken song links, even if I was willing to take the pain, it would take me forever to clean up my library.
I came across a clever idea from Apple Forum, using which I was able to put all the broken song links into one playlist and mass delete them. Here’s how:
1. Create a smart playlist (shortcut: Ctrl+Alt+N) called "All Songs" with this rule: "Artist" is not "123456789? (or any random name from that matter, but make sure it won’t be in your library).
2. Now make a regular playlist (shortcut: Ctrl+N) called "All Live Songs".
3. Create a second smart playlist called "Missing Songs" with these rules: Match all of the following rules, Playlist is "All Songs", Playlist is not "All Live Songs"
4. Select everything from "All Songs" and drag them into "All Songs Files". The broken song links marked (!) will not be copies over to that playlist
5. All your broken songs will be in the "Missing Songs" playlist. Select all (shortcut: Ctrl+A) and delete them!
Note: Mac users have a simpler solution, using a script called Super Remove Dead Tracks.