Adding a Downloadable Calendar Event File to WordPress without a Plugin

Let’s say you’ll be doing an event soon — say a Facebook Live event– and you want to create a calendar reminder for folks to download. Lots of us live and die by calendar invites, so this can be helpful to get people to attend.

It seems like it’d be an easy enough thing to generate a file for this invitation and embed it on a WordPress page, but I managed to mess this up six ways to Sunday recently.

Here’s what I goofed up, and how I got it working.

Note: if you want to skip the long story, there’s a recap of the steps that work at the end of the post.

Generating an invitation file – what not to do on a Mac

I use a mac, so my first attempt was to generate the file using iCal, aka Calendar.app.

I created the event, and then right clicked, and I didn’t see an ‘Export’ option. So I went looking up in the ‘File’ menu and found an ‘Export’ option. DON’T USE THAT!

I thought that would export the event I had selected. Nope, that exports the ENTIRE CALENDAR you’re on. And if you’re me, that means that after you test this file yourself, and it looks normal, you then ask others for a quick test on Twitter and find that you’ve shared events such as “Meatloaf Eating and Motorcycle Racing”, “Kendra eye surgery with Jeremiah as magnificent chauffeur”, and “Paws Cut Off” along with your intended event.

And by the way: my dogs have all their paws, one of them is just a real drama queen every time he gets his nails clipped.

Luckily, I don’t use that calendar for business, so it was only chunks of my personal life that I exposed. While we’re being open, I’m going to also share with you, dear reader, that I find botox very effective at temporarily removing forehead creases. Everyone may as well know.

After quickly deleting that file and clearing every single cache I could find related to my webserver, I tried again! After all, I probably wasn’t going to make this worse.

Generating an invitation file – a better attempt on a Mac, but still not great

This time, I right clicked on the event in iCal, selected “Mail Event”, then saved the attachment from the email.

I also added the extra step of going to the saved .ics file and opening it in a text editor to verify that it contained only a single event, and not my entire personal life (or lack thereof). WHEW, it only had the one event. (I highly recommend this step!)

But I found this still wasn’t perfect. It worked well on iOS, but my friend Steve Jones found that this didn’t open as an invite for him on Outlook 2016, but instead popped up a separate calendar under my email address which he could add as a calendar.

I didn’t want a calendar, I wanted an invite!

What worked: generating the invitation file from my O365 account

I am lucky enough to have a free O365 account as part of my MVP benefit from Microsoft. Joey D’Antoni reminded me of that, so I logged in there and opened the calendar app.

I set up an event in that calendar, but couldn’t find any “export” or “save event file” on the online GUI. So I right clicked it, selected “Forward”, and sent it to my work Gmail account.

Once I got the email, it had a nice .ics file attached. I saved that file, edited it with a text editor and made the MAILTO address in it my work email address (my O365 email address is something hilariously weird), saved it, and tried that file.

This .ics file opened properly as an invitation (not a separate calendar) even in Outlook 2016.

I have not tested, but believe this would also work with a free account at Outlook.Live.com (the artist formerly known as Hotmail).

There’s still one weird thing left! Uploading the .ics file to WordPress

I’ve saved one little gem for last. When you are using the Media Library in wordpress to add new files, if you click the ‘Add New’ button and then browse to your file, the .ics file will appear grayed out and you cannot select it for upload.

It looks like you just can’t do it.

But, if you simply drag the .ics file over into the media library, it uploads fine!

Share!

Related

Interesting and fun, thank you for sharing.
BTW, why don’t you just installed a WordPress Plugin?
Because Plugins slow down WordPress? If so I agree with you and would be a good challenge to try to find out why WordPress DB can slow down so fast.
A good challenge would be also try to see the benchmark of “WordPress + MySQL” VS “WordPress + SQL Server”

Hi. I found your blog while searching for information on creating a .ics file to share as a hyperlink in an HTML email. I did this recently using a website (https://apps.marudot.com/ical/) to create the .ics. When I click the link on my iPhone, it requires me to subscribe to the calendar as if it is a full calendar and not just an event. It does pop up as just the event, but for some reason it also adds a subscription to that calendar as if there were more events…

Did you experience anything like that?

I send out invites on a monthly basis for group meetings and am looking for a more streamlined way to do it.

I heard about something similar happening in Outlook when I generated the .ics file for a single event from iCal (without exporting the whole calendar). When I generated the .ics file for a single event from O365, folks said that didn’t happen in Outlook, and I didn’t have it happen in iCal.