I mistakenly imported an .ICS file into Google Calendar which added 758 events to my personal calendar that I don’t want to have.
Where’s the undo button?
There isn’t a way to undo an import into Google Calendar.
However, thanks to this blog post I found a trick that ended up working for me—with one important modification.
The file I imported into my calendar did not have a “STATUS” field for any of the events. So the find & replace function described in that blog post didn’t work exactly as described.
Here’s the exact process I used.
Undo an import into Google Calendar
- Open the original .ics file in a text editor
Yes… take the same file you imported into Google Calendar. We’re going to make some changes and re-import it. I used Sublime Text, which is one of my absolute favorite editors of all time.
- Search for occurrences of “STATUS”
If your .ics file has “STATUS” fields, then you want to edit each one of them. You can do this in bulk using the “Find & Replace” function in your text editor of choice. If your file has these fields, you can follow the directions in this post to replace the existing status entries. If your file doesn’t have any of those fields, then you can go to the next step like I did.
- Find & replace the “END:VEVENT” field
We need to add a new field to every event in the .ics file. To do this, we’re going to find every occurrence of a field that every event has. I chose to use the “END:VEVENT” field for this.
The trick is that we need to replace that field with itself plus a new field.
So I used this as the “Find” criteria:
And used this as the “Replace” value:
This effectively adds a “STATUS” field to every event, and sets the value of that field to “CANCELLED.”
- Save the edited .ics file and re-import it into Google Calendar
I recommend saving the .ICS file with a new name to avoid any confusion. Then, import the newly edited file into Google Calendar exactly as you imported the original file. Once Google Calendar processes this, it will find every matching event and mark them “Cancelled”—effectively removing them from your calendar.
This technique is especially effective if you intended to subscribe to a feed rather than importing a static set of events.
This is precisely what I wanted to do. I want to stay up to date with changes on the 3rd-party calendar, not capture a snapshot of everything on it today and then treat them all as appointments.
Hopefully, this will help someone other than me. Cheers!Related Posts: