Code snippet for in-browser bulk deletion of Google Calendar events
- You imported events (e.g from an
.ics
file) into the wrong target calendar. - You want to clean up your calendar
- You don't want to delete the events manually
It bulk deletes the list of calendar entries currently displayed.
The script does not handle additional confirm dialogs (e.g. for recurring events)
Open Google Calendar, now Search
for your target events you want to delete. Use the rich mask that Google Calendar offers here.
As soon as you verified that only those events are displayed, which you want to delete, open the developer tools via F12
and paste the snippet into the console. Hit ENTER
and watch the show 🍿.
Paste this snippet into your browser's console and hit ENTER
.
bulkDelete();
function bulkDelete() {
const list = Array.from(document.querySelectorAll('[role="main"] [role="rowgroup"] [role="presentation"]'));
if (list.length === 0) return;
list[0].click();
setTimeout(() => {
document.querySelector('[aria-label="Delete event"]').click();
setTimeout(() => bulkDelete(), 500);
}, 500);
}