Hello devs and music lovers! 👋
Like many of you, I've been using YouTube Music for years. Over time, my "Liked Songs" playlist became a massive graveyard of tracks I no longer listen to. I wanted a fresh start.
Naturally, I looked for a "Remove All" button. Spoiler alert: It doesn't exist. 🚫
I tried using some old scripts I found on Reddit and StackOverflow, but they all had the same problems:
- They were outdated (didn't work with the new UI).
- They clicked too fast, triggering YouTube's Rate Limiting (Spam Protection), which blocked the process after 20-30 songs.
🛠️ The Solution: "Sniper Mode"
Since I couldn't find a working tool, I decided to build one. I wrote a JavaScript automation script designed specifically to bypass these limitations.
How it works:
Instead of collecting all buttons and clicking them in a loop (which crashes the browser), my script uses a "Sniper" logic:
- It finds the current active "Unlike" button on the screen.
- It clicks it.
- It waits for a realistic, human-like delay (to keep the API happy).
- It automatically scrolls down when the current batch is cleared to load more songs.
It works on both English ("Undo like") and other language interfaces (like Turkish "Beğenmekten vazgeç").
💻 The Code
I've open-sourced this project on GitHub. It's a simple script you can run directly in your browser's console.
You can find the repo and instructions here:
👉 [https://github.com/gktrk363/youtube-music-cleaner]
🚀 How to use it?
- Go to
music.youtube.comand open your Liked Songs playlist. - Open Developer Tools (Press F12 or right-click > Inspect).
- Go to the Console tab.
- Copy the code from the GitHub repo above, paste it into the console, and hit Enter.
- Watch it clean your library one by one! 🧹
Final Note
This script is for educational purposes and personal use. I tested it on my own library of 750+ songs, and it cleared everything without getting blocked.
If you find it useful, a star on GitHub would be much appreciated! ⭐
Happy coding!
Top comments (0)