-
Notifications
You must be signed in to change notification settings - Fork 138
Open
Description
Adding this here in case it's of use to anyone. The current script doesn't work (and seems not being supported anymore).
I put together this script that deletes one page at a time. To use it:
- Go to reddit your overview page: https://old.reddit.com/user/me
- Open the dev tools (usually F12 on most browsers).
- Go to the console tab, and paste the script below and press enter.
- The script deletes a page and reloads the page. Because the focus remains on the console, press the up key and press enter.
(async () => {
// Get all visible "delete" comment links
const deleteLinks = Array.from(document.querySelectorAll('div.entry form.del-button a'))
.filter(a => a.textContent.trim().toLowerCase() === "delete");
if (deleteLinks.length === 0) {
alert("No deletable comments found on this page.");
return;
}
for (let i = 0; i < deleteLinks.length; i++) {
deleteLinks[i].click();
// Wait for the confirmation dialog
await new Promise(r => setTimeout(r, 100));
}
const confirmations = Array.from(document.querySelectorAll('div.entry form.del-button span.active'))
.filter(s=>s.textContent.trim().toLowerCase() === "are you sure? yes / no");
for (let i = 0; i < confirmations.length; i++) {
await new Promise(r => setTimeout(r, 1000));
confirmations[i].querySelector('a').click();
}
location.reload();
})();
You might need to play with the sleeps, as it seems reddit not always deletes the posts even after giving a success response.
Metadata
Metadata
Assignees
Labels
No labels