Skip to content

Instantly share code, notes, and snippets.

@jziggas
Last active July 21, 2025 20:05
Show Gist options
  • Save jziggas/db8f9ffd296b49d484725a52c3f92406 to your computer and use it in GitHub Desktop.
Save jziggas/db8f9ffd296b49d484725a52c3f92406 to your computer and use it in GitHub Desktop.
JavaScript to delete all of your Reddit comments
// Go to https://www.reddit.com/user/<username>/ and paste into your console.
// Reddit throttles these actions, hence the 1s timer.
let interval = setInterval(() => {
let deleteButtons = $('a.togglebutton[data-event-action="delete"]');
if (deleteButtons.length === 0) {
clearInterval(interval);
if ($('.next-button > a')[0]) {
$('.next-button > a')[0].click();
alert('Restart script.');
}
} else {
deleteButtons[0].click();
setTimeout(() => {
$('span.option.error.active > a.yes').click();
}, 300);
}
}, 1000);
@Acrasy
Copy link

Acrasy commented Mar 14, 2024

pls change url to

old.reddit.com/user/<username>/

@ash3rr
Copy link

ash3rr commented Jul 21, 2025

old.reddit eventually blocks you with a 429

@jziggas
Copy link
Author

jziggas commented Jul 21, 2025

i would just increase the timeout from e.g. 1 second to 3 or 5 seconds so that the frequency of network requests doesn't trigger a 429

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