Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save xamantra/0abdec366eebcea622f569ff838a7fda to your computer and use it in GitHub Desktop.
Save xamantra/0abdec366eebcea622f569ff838a7fda to your computer and use it in GitHub Desktop.
Delete all entries inside a list category in MAL. Useful for getting a fresh start in your Plan to Watch or any other section (Completed, On Hold, Dropped, Currently Watching).
var index = 0;
if (confirm(`Are you sure you want to DELETE ALL your entries in this section?`)) {
$("a.animetitle").each(function () {
var animeLink = $(this).attr("href");
var animeId = animeLink.substring(
animeLink.lastIndexOf("anime/") + 6,
animeLink.lastIndexOf("/")
);
var deleteUrl = `/ownlist/anime/${animeId}/delete`;
setTimeout(function () {
console.log(`[DELETE] Executing "${deleteUrl}"...`);
$.ajax({
type: "POST",
url: deleteUrl
});
}, index * 1000);
index++;
});
}
var index = 0;
if (confirm(`Are you sure you want to DELETE ALL your entries in this section?`)) {
$("#list-container > div.list-block > div > table > tbody > tr.list-table-data > td.data.image > a").each(function () {
var animeLink = $(this).attr("href");
var animeId = animeLink.substring(
animeLink.lastIndexOf("anime/") + 6,
animeLink.lastIndexOf("/")
);
var deleteUrl = `/ownlist/anime/${animeId}/delete`;
setTimeout(function () {
console.log(`[DELETE] Executing "${deleteUrl}"...`);
$.ajax({
type: "POST",
url: deleteUrl
});
}, index * 1000);
index++;
});
}
var index = 0;
if (confirm(`Are you sure you want to DELETE ALL your entries in this section?`)) {
$("a.animetitle").each(function () {
var mangaLink = $(this).attr("href");
var mangaId = mangaLink.substring(
mangaLink.lastIndexOf("manga/") + 6,
mangaLink.lastIndexOf("/")
);
var deleteUrl = `/ownlist/manga/${mangaId}/delete`;
setTimeout(function () {
console.log(`[DELETE] Executing "${deleteUrl}"...`);
$.ajax({
type: "POST",
url: deleteUrl
});
}, index * 1000);
index++;
});
}
var index = 0;
if (confirm(`Are you sure you want to DELETE ALL your entries in this section?`)) {
$("#list-container > div.list-block > div > table > tbody > tr.list-table-data > td.data.image > a").each(function () {
var mangaLink = $(this).attr("href");
var mangaId = mangaLink.substring(
mangaLink.lastIndexOf("manga/") + 6,
mangaLink.lastIndexOf("/")
);
var deleteUrl = `/ownlist/manga/${mangaId}/delete`;
setTimeout(function () {
console.log(`[DELETE] Executing "${deleteUrl}"...`);
$.ajax({
type: "POST",
url: deleteUrl
});
}, index * 1000);
index++;
});
}
@KennethBenicio
Copy link

The script does not work anymore, probably due to an update to the MAL site. It can be fixed by changing the 3rd line to

$("a.animetitle").each(function () {

I tried this, but didn't work. I'll look this up again later.

The original script works just fine here.

@sn1c
Copy link

sn1c commented Feb 6, 2020

@KennethBenicio Can you send me the exact link of the site on which it works for you?

@KennethBenicio
Copy link

@KennethBenicio Can you send me the exact link of the site on which it works for you?

I used the script on my MAL's Plan to Watch page

@sn1c
Copy link

sn1c commented Feb 10, 2020

@KennethBenicio Can you send me the exact link of the site on which it works for you?

I used the script on my MAL's Plan to Watch page

This is weird. As you can see here, for me only my version works. Do you have a skin? What's your browser? Maybe MAL changes depending on the browser.

@xamantra
Copy link
Author

I have a suspicion that the issue is on the custom list layout.
I'm going to try to experiment this later after I got home since I'll be having lots of free time.

@xamantra
Copy link
Author

xamantra commented Feb 10, 2020

IMPORTANT NOTICE

The original script doesn't work on "classic" list design. It works fine on modern style design (and I don't think custom list design matters): See This

Edit: I renamed the original script to indicate that's for modern list style and added separate script for classic list style.

@MysticRose2040
Copy link

Where do you put this code so it can work?

@xamantra
Copy link
Author

xamantra commented Feb 16, 2020

Where do you put this code so it can work?

You put it in here
If you are on your plan to watch section, your plan to watch will be deleted. Same goes for other tabs.

@MysticRose2040
Copy link

Thanks! and I was wondering if it works on the manga list too?

@xamantra
Copy link
Author

xamantra commented Feb 18, 2020

Thanks! and I was wondering if it works on the manga list too?

Currently it doesn't, but it's easy to write another script for that. Will do it later.

@dattenlagiday
Copy link

dattenlagiday commented Apr 26, 2020

Thanks! and I was wondering if it works on the manga list too?

just change the line: animeLink.lastIndexOf("anime/") + 6, to animeLink.lastIndexOf("manga/") + 6,
and var deleteUrl = /ownlist/anime/${animeId}/delete; to var deleteUrl = /ownlist/manga/${animeId}/delete;
worked for me

@aerynes
Copy link

aerynes commented Jan 19, 2022

I used the classic anime, and the classic manga, they worked perfectly. Arigatou!

@jeyjai
Copy link

jeyjai commented Sep 13, 2023

Thank you so much, still works perfectly. Just make sure you use the correct version.
If you wanna do it on your phone, use kiwi browser.

The moronic mods on MAL are literally telling ppl not to use scripts, not to create new accounts, they're both bannable offenses. And to just suffer through it and remove everything manually because the other methods are taxing on their servers.... I'd rather switch service than waste an hour doing it manually

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment