Embedding Google calendars in WOU WordPress pages

This is a question that’s come up several times as people are migrating departmental sites into WordPress. It seems WordPress doesn’t like iframes, and they don’t consider that a bug. While I agree there are still a few security concerns with iframes, they aren’t nearly as much of a scream-and-run-away as they were in older browsers.  WordPress still considers them too much of a risk, and won’t let anybody except a global administrator put an iframe into a post or a page.  If anybody else does, that code just gets stripped out when they save the page. And if an admin does put in an iframe, as soon as anybody else edits the page, the code gets stripped. That’s why some people were seeing calendars disappear.

Luckily, someone wrote a WP plugin that lets any editor put in iframes as shortcodes. That plugin is activated on all our sites. So here’s what you do to get a google calendar embedded into a WP page:

  1. Get the iframe HTML code:
    In Google Calendar, look in the My Calendars sidebar for the calendar you want to embed in WordPress. In the dropdown menu for that calendar, click settings to go to the settings page. On that page will be a snippet of HTML code you can use to embed the calendar. That snippet will look something like:

    <iframe src="https://www.google.com/calendar/embed?src=swartzer%40mail.wou.edu&ctz=America/Los_Angeles" style="border: 0" width="800" height="600" frameborder="0" scrolling="no"></iframe>
  2. Put that code into WordPress:
    Edit the page where the calendar needs to display. Paste in the HTML snippet, delete the </iframe> from the end, and change the angle brackets to square brackets. The snippet should now look something like:

    [iframe src="https://www.google.com/calendar/embed?src=swartzer%40mail.wou.edu&ctz=America/Los_Angeles" style="border: 0" width="800" height="600" frameborder="0" scrolling="no"]
  3. That’s it!
    Just hit Update on the page to save it, then view it.  If you don’t see the calendar, let me know.

Oh, and this trick works on any iframe, not just Google calendars.

30 thoughts on “Embedding Google calendars in WOU WordPress pages

  1. great post , very intelligence shows . we enjoy it .if want to grow your business then Google Review is very important for the business. This will make your business very popular.
    If your business has no reviews or more negative reviews, you can contact our website and we will try to help.
    buy google reviews uk

  2. Hello, you did a great job.meets the informal criteria in each of those facets. This tool is rated to create prints at a rate of 40 pages per min (ppm). This is far better than numerous other gadgets in the very same course but is in no other way a breakout champion.

  3. This is a question that’s come up several times as people are migrating departmental sites into WordPress. It seems WordPress doesn’t like iframes, and they don’t consider that a bug. While I agree there are still a few security concerns with iframes, they aren’t nearly as much of a scream-and-run-away as they were in older browsers.

Leave a Reply

Your email address will not be published.