How to Easily Remove Duplicate Tracks on iTunes [Windows]

ituneslogo   How to Easily Remove Duplicate Tracks on iTunes [Windows]Today, I’m going to cover how to remove duplicate tracks from iTunes. During my recent Windows 7 rebuild, I made a number of strategic errors. Nothing devastating, unless you include the mess I seem to have got my once pristine iTunes library in. I’ve ended up with everything I need”¦ and more. I’m going to talk you through what you can do to remove duplicates in iTunes.

I’m a Windows guy, so some of your options will certainly differ if you’re one of those Apple types. Not that there’s anything wrong with that.

Remove Duplicates from iTunes – Before we start

We’ve talked about iTunes before. A lot! Relating to this particular subject, David Pierce explained how to use TidySongs to manage iTunes, and more broadly, Jackson produced a great eBook to help with all your iTunes needs.

How did this happen?

If only I knew. It’s a combination of recopying files to the machine after the rebuild, using the wonderful SharePod to rebuild the library, and some peculiar choices in the iTunes options.

Never mind. That’s ancient history, and there are many paths to this place. Doubtless, you took a different one.

Things to check

There are two things you want to make sure of before proceeding to remove duplicates from iTunes, and one general word of warning.

First, the warning. Please, please ensure you have backups in place in case any of this goes wrong. You are going to delete files, and you want to be sure you can get them back if nothing else.

If you are allowing iTunes to manage your files, you can just copy the entire iTunes folder (and all the subfolders) somewhere else. If you are managing the files yourself, take a look and be sure where you stand. Missing tracks is much worse than duplicate tracks.

somedupes   How to Easily Remove Duplicate Tracks on iTunes [Windows]

There are two different ways that you can end up with duplicate tracks listed in iTunes. We ware here to remove actual duplicates. But first you need to check if you have duplicate items listed, but they are actually the same files. You can do this by sorting the tracks in name order (click on the Name column header), then right clicking one of the duplicates, and choosing Get Info.

getinfo1   How to Easily Remove Duplicate Tracks on iTunes [Windows]

Click on the Summary tab, and take a look at the file path after the Where: and then click on the Previous and Next buttons and compare the duplicates. Make sure the file names are at least a little bit different, or deleting one will delete both. In my case I have an Africa.mp3 and an Africa(1).mp3, for example.

The other thing to watch for is that the tracks are not near-duplicates. You know the stuff. You have the studio version, the live one, the unplugged one from the Nineties, the extended dance remix”¦ be sure you really want to get rid of those. Oh, lose the dance one. Go on.

Search and Eliminate

You probably already know you have some, and sorting your library by Title will certainly make it more apparent. If you have a small library, perhaps that’s all the help you need. It’s not going to work for me. I’ll still be working on it next year.

showdup1   How to Easily Remove Duplicate Tracks on iTunes [Windows]

The first level of assistance is to ask iTunes to show you the duplicates. That’s easy. With your library still sorted by Title, click on File | Display Duplicates. This was when I started to get concerned. That’s a LOT of duplicate tracks.

If you want to reduce the work here a little, you can also ask iTunes to take a little more care with the selection. By default it’s only going to check the titles, but if you click on the Show All button to put things back to normal, and then go back through the process but this time hold the Shift key down while you click on File then you’ll get a Display Exact Duplicates option. For me, this made no difference at all but your mileage will vary depending on how you got the duplicates in the first place.

After that, the process consists of deleting the one (or more if necessary) duplicate files that you don’t want.

Getting help with the heavy lifting

dupeelimlogo   How to Easily Remove Duplicate Tracks on iTunes [Windows]I investigated making use of third-party products to take the back-breaking repetition out of the process. Dupe Eliminator isn’t a free product, but the trial version will let you make use of the comprehensive duplicate selection criteria. Unfortunately, it won’t then remove all the duplicates automatically. I can understand that though, because why else would you purchase the full version? I moved on.

You Apple folk also have a whole stack of Apple Script options, but I can’t get near those.

My next option was a free piece of software called Duplicate Music File Finder. This one works outside iTunes, so there’s a need to clean up the resulting dead links afterwards. Hold your breath, start the app, point it at your music files, and let it check them out.

dmff   How to Easily Remove Duplicate Tracks on iTunes [Windows]

Just before we go further, a reminder. I’m trying to help, but the risk is yours. You need to have backed up all your music before you start.

Click the Check All button if you are happy that the duplicates have been selected, and then click on Delete Checked Files to actually remove them. Click Yes to confirm.

recycle   How to Easily Remove Duplicate Tracks on iTunes [Windows]The application behaved for me exactly as expected, and all the duplicate files were moved to the Recycle Bin.

The last step in the process is to tell iTunes to take a look at itself, and remove any items in the library which no longer exist. Unfortunately there is no simple way in the iTunes interface to do this, so we need to cheat, just a little.

Apple has provided a script to do just this particular trick, and to make use of it you just need to do these things in order:

  1. Close iTunes if you have it open
  2. Go to the web page, right-click on it, and save the page as a file, making sure you change the extension to .js. So for instance, in Firefox, right-click on the page, choose Save page As”¦ and change the file name from RemoveDeadTracks.txt to RemoveDeadTracks.js.
  3. Open Windows Explorer and browse to the file you just saved
  4. Double-click on the file.

The script will open iTunes, and then start running through and removing dead links. In my case it took around ten minutes and correctly removed nearly two thousand links.

removed   How to Easily Remove Duplicate Tracks on iTunes [Windows]

Give yourself a pat on the back.

itunesafter   How to Easily Remove Duplicate Tracks on iTunes [Windows]

I’d love to know how you go, whether you have found any more comprehensive tools, or if you can fathom how I got in this mess. In the comments, please.

Check out more about:

The comments were closed because the article is more than 180 days old.

If you have any questions related to what's mentioned in the article or need help with any computer issue, ask it on MakeUseOf Answers—We and our community will be more than happy to help.

25 Comments -

David Johnston

Thanks,having made numerous bad choices whilst in the middle some ill thought out “upgrade” or other I appreciate the Info.Especially the shift file.If I ever knew it I’d forgotten.

Jim Henderson

Thanks David. I’m pleased I could be of some use. There’s no need for us all to go through these things over and over.

Jim

James

I’ve been using AudioComparer to remove my song duplicates. I use to have over 45,000 songs before I used it. AudioComparer listend to all of my music and then showed me which songs were identical based on the sound and NOT the tags. Which is how it should be!

Jim Henderson

Looks pretty interesting, James. It’s worth noting that it’s not free.

Thanks.

Claus Valca

Funny…

Just spent last night tiding these up myself after a system recovery (iTunes partition bombed and I “restored” it from my iPod brick), then ended up porting over manually from the system to a new laptop.

In the process I had lots of duplicates in the Library listing and music/video files scattered all over the darn place…including duplicates and triplicates…

Once I got the main iTunes (storage location) settings dialed in, I removed the duplicate listings in the Library as suggested above, then I did a consolidation to ensure that all the media files scattered around the folders were placed into that store.

Then I went into the store location and could pretty easily see the duplicate media files (often named with a 1 – or – 1 pre/post file name) and deleted these, leaving the original media file in the location. That saved me a bunch of space!

Now what this did was (in many cases) break the association with the library entry for some songs. At first I was manually launching each one then manually locating it via browsing. With almost 3000 files, that was taking a long time.

So I just bravely deleted the entire list of files in the Library but IMPORTANTLY!!! told it to keep the media files and NOT delete them (just the Library items).

Then I went back to the file menu in iTunes and had it add the media from the folder contents…and selected the primary user iTunes media folder location that I had just cleaned up.

Zammo! All 3000 items were back with the correct associations now.

I also then was able to clean up my playlists by exporting them, then doing a find/replace in Word swapping out the old folder location string with the updated one.

Happy Dandy!

Lots of work but all clean and neat again, dups are gone, and no loss occured in my case. Learned a lot about the iTunes media management system as well in the process.

This post had lots of awesome tips I merged to work out the above… http://www.kadavy.net/blog/posts/transfer-itunes-library/

Freeware app SharePod was the biggest (Windows app) utility helper to restore my iTunes library from my iPod device after the first system tanked the files… I documented that nightmare recovery experience here iTunes Damage Control

Additional links from iTunes help:
http://support.apple.com/kb/ht1364 – Consolidation option
http://support.apple.com/kb/HT2905?viewlocale=en_US – Duplicates
http://support.apple.com/kb/HT1660 – iTunes library location
http://support.apple.com/kb/HT1751 – moving iTunes between HDD’s.

Great and timely post! Thanks!

Cheers!

Claus V.

Claus V

Jim Henderson

Thanks Claus. Very comprehensive. Just one question… Did you lose your play counts and ratings by doing this?

Cheers

Jim

Claus Valca

Funny…

Just spent last night tiding these up myself after a system recovery (iTunes partition bombed and I “restored” it from my iPod brick), then ended up porting over manually from the system to a new laptop.

In the process I had lots of duplicates in the Library listing and music/video files scattered all over the darn place…including duplicates and triplicates…

Once I got the main iTunes (storage location) settings dialed in, I removed the duplicate listings in the Library as suggested above, then I did a consolidation to ensure that all the media files scattered around the folders were placed into that store.

Then I went into the store location and could pretty easily see the duplicate media files (often named with a 1 – or – 1 pre/post file name) and deleted these, leaving the original media file in the location. That saved me a bunch of space!

Now what this did was (in many cases) break the association with the library entry for some songs. At first I was manually launching each one then manually locating it via browsing. With almost 3000 files, that was taking a long time.

So I just bravely deleted the entire list of files in the Library but IMPORTANTLY!!! told it to keep the media files and NOT delete them (just the Library items).

Then I went back to the file menu in iTunes and had it add the media from the folder contents…and selected the primary user iTunes media folder location that I had just cleaned up.

Zammo! All 3000 items were back with the correct associations now.

I also then was able to clean up my playlists by exporting them, then doing a find/replace in Word swapping out the old folder location string with the updated one.

Happy Dandy!

Lots of work but all clean and neat again, dups are gone, and no loss occured in my case. Learned a lot about the iTunes media management system as well in the process.

This post had lots of awesome tips I merged to work out the above… http://www.kadavy.net/blog/pos

Freeware app SharePod was the biggest (Windows app) utility helper to restore my iTunes library from my iPod device after the first system tanked the files… I documented that nightmare recovery experience here iTunes Damage Control

Additional links from iTunes help:
http://support.apple.com/kb/ht… – Consolidation option
http://support.apple.com/kb/HT… – Duplicates
http://support.apple.com/kb/HT… – iTunes library location
http://support.apple.com/kb/HT… – moving iTunes between HDD’s.

Great and timely post! Thanks!

Cheers!

Claus V.

Claus V

Yohanna

Hi Jim
Many thanks for this post, it’s very useful & user-friendly enough for a complete novice like me. I have however come unstuck at the RemoveDeadTracks.js phase – I can save it as a file alright but when I navigate to it and double-click it brings up a rude Windows Script Host blue box that tells me there’s been a ‘Line: 1, Char: 1, Error: Syntax Error, Code 800A03EA, Source: Microsoft JScript compilation error’. No doubt this is something that could be resolved by anyone with half a neuron of IT knowledge but unfortunately I’m not one of those people. Any ideas??

Thanks again.

Jim Henderson

Hi Yohanna.

Sorry to hear you’re having trouble.

I’d be checking the way it’s saved the file if I were you. It sounds as though you’ve lost a character at the beginning of the file or something. Any chance you could let me know how you went about saving it?

Yohanna

Hi Jim
I simply click on the link in your article, the first part of which shows up like this:

/*
File: RemoveDeadTracks.js

Version: 1.0

Right-clicking on the page doesn’t bring up a ‘Save as’ option, so I go to File > Save As, which brings up the Save box with RemoveDeadTracks written in the File Name box. In the ‘Save as type’ box it says Text File (*.txt) – but I can’t delete this. I then add ‘.js’ to the end of the file name. It then appears in my computer as ‘JScript Script File’ under the Properties, which it says opens with Microsoft (R) Windows Based Script Host. I double click on the file and I get the rude message. I’m stumped!

Thanks for your interest in helping me!!

Jim Henderson

Okay, I think that’s where the problem is. You should be able to right-click on the link from this page, and choose *save link as…* if you are using Firefox, or *save target as…* in Internet Explorer. Save it as removedeadtracks.js, rather than .txt, and you should be fine.

Cheers

Yohanna

Success!! Thanks Jim – works perfectly! I don’t know how I managed to stuff that up…

Jim Henderson

Superb! I’m glad it worked out for you.

Patrick

Hi Jim.

I was having the same problem as Yohanna and was able to sort it out, thanks to your excellent instructions. One note I wanted to share with anyone doing this- if you have a lot of files (songs) with generic/untitled file names (e.g., “track 1, track 2, etc.), it probably is not a good idea to look for duplicates by name. Luckily, I perused the info at the bottom of the Duplicate Music Files Finder and identified that many of my duplicate tracks had differient file paths (e.g., were from different albums). Just something to be aware of.

Claus Valca

@ Jim

Yep. No retention of play counts or song ratings.

However, I don’t really use those features much. Play counts are interesting when checking the “randomness” of the shuffle-play events and I have never bothered to rate songs.

I do know some folks who live for those things though and loss of that data would be a major bummer.

–Claus V.

Jim Henderson

Yep. Horses for courses then. Just as it should be.

Julie

Thank you so much! I had isolated all the dead tracks into a smart playlist, but itunes would not let me delete them. They were mostly home movies from my camera that I had converted to “music videos.” I don’t know if this is why I couldn’t delete. In any case, I found your article, and it was so great to watch that playlist go from 16gb to empty. Thanks so much!

Jim Henderson

I’m so pleased I could help!

Patrick

Hi Jim.

I was having the same problem as Yohanna and was able to sort it out, thanks to your excellent instructions. One note I wanted to share with anyone doing this- if you have a lot of files (songs) with generic/untitled file names (e.g., “track 1, track 2, etc.), it probably is not a good idea to look for duplicates by name. Luckily, I perused the info at the bottom of the Duplicate Music Files Finder and identified that many of my duplicate tracks had differient file paths (e.g., were from different albums). Just something to be aware of.

jtfburgess

Thanks for this post. I searched around everywhere for a good solution, and this was the first one that worked perfectly. Good information, efficiently presented.

Courtam

Thank you some much – this worked great for me I have a pretty large collection and it was kind of messed up. This was easy and no problems at all.