Well crap.
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:
END:VEVENT
And used this as the “Replace” value:
STATUS:CANCELLED
END:VEVENT
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!
5
It worked for me!!! Thanks 🙂
Unfortunately, did not work for me. It seems to work only if the imported event has the same UID as the one already in the calendar. But the original import file did not have UIDs.
Awesome, this worked for me! Thanks 🙂
I am doing this with a Facebook ical import – unfortunately events which were cancelled on Facebook (but not deleted, hence they still show on Facebook) are still not gone from ical. I have this kind of code – how do I amend it pls?
STATUS:CONFIRMED
PARTSTAT:TENTATIVE
STATUS:CANCELLED
END:VEVENT
thank you so much!
Thanks, In notepad2 or notepad++ you have to put the replacement as:
STATUS:CANCELLED\nEND:VEVENT
the \n creates the new line.
Totally worked for me! Big thanks!
Awesome! Thanks, @buyair. I really appreciate you taking the time to say something!
Saved me, thank you kindly.
That’s really great to hear, @T. I’m glad you found this useful and I can’t thank you enough for taking the time to leave a comment. Thanks!
Oh my gosh! You are a lifesaver. I WISH Google would develop an undo or a workaround. This was the perfect fix.
Thank you so much! This was the first article I could find that had an alternative to replacing STATUS:CONFIRMED with STATUS:CANCELLED, which didn’t work for me, even though the original import had UIDs.
HOORAY!!! I also used the steverand modification above for a line break, installed Notepad2 (after trying Notepad and Notepad++), also check the “Translate backslashes” option in Notepad2 Replace, and Save as a new file (choose “All Files” not “txt” and append “.ics” after the file name)