Howto: Undo iCal import in Google Calendar

Written by Tom Verhoeff on. Posted in Eveoh

Imagine this situation: you just imported your full schedule for this semester into your main Google Calendar when you decide make some changes to your courses or want to switch to an iCal feed. In this and many other cases it would be nice if Google provided any form of undo import option. Unfortunately there is no automated way of doing this just yet, so manually deleting all events seems to be the only option. Somebody came up to me today asking if there is any way of solving this problem, so i figured something out. All you need is the original ics file and a simple text editor. To get started open up your ics file in a simple text editor. On windows built-in notepad would work, but i prefer Notepad++. You will notice that an ics file basically consists of a long list of data for all events in the file. We need to trick Google Calendar into believing that all the events are cancelled. The iCal format contains a lot of parameters, one of them is the “Status” parameter. Usually in ics files this is set to confirmed. We will use this status to trick Google Calendar.
  1. Open the find/replace function
  2. Replace all occurrences of “STATUS:CONFIRMED” to “STATUS:CANCELLED”
  3. Save the file
  4. Re-import the file to the same Google Calendar
By design Google Calendar will now update all activities with the new status. In this case it means all events get a “Cancelled” status and will therefore be removed from your calendar. Problem solved! If you encounter any problems it might help to also increase the sequence number. In this case replacing “SEQUENCE:” with “SEQUENCE:99” should to the trick. Please let me know if you encounter any other problems.

Tags: , , , , , , , , ,

Trackback from your site.

Comments (138)

  • Basil

    |

    Good method, used to work, but doesn’t seem to work anymore ๐Ÿ™

    Reply

  • ross

    |

    Thanks
    Worked well for me.
    .and saved a llot of hassal
    Thanks

    Reply

  • Anders

    |

    Thanks a lot, this just helped me big time – I imported over 1000 appointments into the wrong calendar!

    Reply

  • sp1r1t

    |

    u saved my day, thx a lot

    Reply

  • Angie

    |

    I just gave this a try (after importing the wrong calendar) and you saved me a tone of work… THANK YOU !!!

    Reply

  • Lars

    |

    How come my ICS-file doesn’t contain any “STATUS” parameter? I would REALLY like to use this trick.

    Reply

  • Tom (not Voerhoff)

    |

    @Lars

    Neither did mine, the file consisted of some metadata and several hundred entries of the following format:

    BEGIN:VEVENT
    UID:
    […]
    DESCRIPTION:
    CLASS:PUBLIC
    END:VEVENT

    So I just added STATUS:CANCELLED as the second to last line in each of the entries by replacing “END:VEVENT” with “STATUS:CANCELLED\nEND:VEVENT” and the “Extended” Search Mode in Notepad++’s Search & Replace dialog.

    Just to make it clear, the result should be this:

    BEGIN:VEVENT
    UID:
    […]
    DESCRIPTION:
    CLASS:PUBLIC
    STATUS:CANCELLED
    END:VEVENT

    That worked beautifully (just now, so it’s definitely still working) and saved the day! Thank you (other) Tom.

    (Sidenote: This is a giant blunder on Google’s part. *Every single time* I import an .ics file I narrowly escape the trap that is “import into private calendar by default”.)

    Reply

  • Tom (not Voerhoff)

    |

    PS.: Funny, the scenario “Imagine this situation: you just imported your full schedule for this semester into your main Google Calendar when you decide make some changes to your courses or want to switch to an iCal feed.” is PRECISELY what had happened to me!

    Reply

  • David T

    |

    Hey @Lars Thank you very much. Your fix worked. Thank you again.

    Reply

  • Ben

    |

    Thank you for the HOURS of work you saved me from having to do. Worked like a charm!

    Reply

  • Jim

    |

    Just imported someone’s attempt at some rugby fixtures into my calendar. They don’t do it the way I like, so used this and in two minutes the 300 odd entries were gone again. Thanks, saved me an age!

    Reply

  • David V

    |

    Thank u so much OP & Lars!!!

    Reply

  • Marie W

    |

    Thank you! This worked wonderfully!

    Reply

  • Random Guy

    |

    Thank you SO much. It worked with a NASA calendar I imported in my main calendar.

    It is a huge design flaw from Google’s part, I find it absolutely astonishing it is designed that way.

    Reply

  • drsoni

    |

    thank you very much , it worked like anything.
    ๐Ÿ™‚

    Reply

  • zirang

    |

    Thanks a lot, this just helped me big time.

    Reply

  • Petric

    |

    Yes it works! Thank you so much!

    Reply

  • Jon

    |

    Thank you thank you thank you – inadvertently imported 1645 cricket matches into my main calendar… now all gone again, thank Christ

    Reply

  • sari

    |

    Thank you!!

    Reply

  • Vassil

    |

    Thank you!! I accidentally imported nearly 3000 records about the tide charts near where I live into my main calendar but your trick made it possible for me to retain my sanity. ๐Ÿ™‚

    Reply

  • JULIA

    |

    You’re a lifesaver! Thank you for the great, clear instructions!

    Reply

  • blueniNJa

    |

    worked like a charm ๐Ÿ™‚

    thanks

    Reply

  • LEEA

    |

    i was worried id loose other item so i tried the above notepad++ stuff but to only one event in the numerous event to see if it works and when importing calendar reported an error
    QUOTE:Processed 52 events.

    Successfully imported 51 events.

    Failed to import events: Some of the events in this file were not imported because you had imported them to Google Calendar before. Other events in this file have been imported..

    ??? does status cancelled have to appear in every event to work?
    the way im reading it is google calendar didnt understand the status:cancelled script! ???

    Reply

  • Me

    |

    Thanks! Awesome!

    Reply

  • Chris

    |

    Thank you! Notepad and pasting cancelled and re importing worked!

    Reply

  • Machin

    |

    Worked like a charm. Thanks a lot !

    Reply

  • Eli

    |

    I’ve imported a calendar with a lot of events by mistake and I did not know how to remove them all quickly. Thank you very much.

    Reply

  • Olivier

    |

    You saved my life…

    Reply

  • Nitin

    |

    Awesome tip for the ones who produced iCal from Outlook. Thanks a ton guys ๐Ÿ™‚

    Reply

  • Joe

    |

    Thanks! This was a life saver.

    Reply

  • nun

    |

    Thanks a ton!

    Reply

  • Derek

    |

    Nice! You saved me HOURS of work! Internet high five!

    Reply

  • Kirti

    |

    AWESOME FIND!!!
    Your link should come up 1st in the searches. You ARE a life saver when one has to delete 100s of such entries (my case 300+). Thanks a Lot!!!

    Reply

  • design logo

    |

    Evesrything is very open with a cear explanation of
    the issues. It was truly informative. Youur site is very helpful.
    Thank you for sharing!

    Reply

  • Eric Wieser

    |

    So glad I found this. Especially easy given I produced the offending ics file programmatically, since I could just spit out that line.

    Thanks for saving me so much time!

    Reply

  • Daniel

    |

    Saved my day! Thanks so much!

    Reply

  • ropo

    |

    Thanks! It worked after replacing BEGIN:VEVENT with BEGIN:VEVENT\nSTATUS:CANCELLED
    Had tu use Notepad++ and enable \n in search&replace

    Reply

  • pulau tidung

    |

    whoah this blog is magnificent i like studying your posts.
    Keep up the good work! You recognize, a lot
    of persons are looking round for this information, you could help
    them greatly.

    Reply

  • Anastasia B

    |

    HELP!!!! I did what you said in Notebook ++, but when I tried to save, it didn’t give me the option of saving it in an .ics format.
    What am I doing wrong? Clearly something, as it worked for so many others.
    HELP!!! I imported my whole new company’s calendar into my google calendar that I’ve had for 7 years!

    Reply

  • Joe D

    |

    Anastasia B – You need to “save” the file (in it’s original form), rather than “save as…”. This will keep the file in the .ics format

    Reply

  • lorraine

    |

    THANK YOU, THANK YOU, THANK YOU!!!!!!

    Reply

  • Raymond Bryan Horton

    |

    Thanks! You saved me hours of correcting a dumb mistake!!!

    Reply

  • Marcy

    |

    You’re a wonderful man. I’m going to name one of my children after you. Thank you!

    Reply

  • Sarah

    |

    Thank you so much ๐Ÿ™‚

    Reply

  • Luis

    |

    Tanks! this worked, and saved me from a painful headache.

    Reply

  • Scott Means

    |

    You just saved me from having to dump my personal Google calendar. You’re a genius!

    Reply

  • Jozsef

    |

    Many, many, many thanks! It worked perfectly.

    Reply

  • Nitin

    |

    Thanks, it worked perfectly. BTW, if “/n” does not work on Windows, try using “/r”.

    Reply

Leave a comment