Do you want to add a Google Calendar in your WordPress site?
Google Calendar makes it easy to promote in-person and virtual events to the people who visit your website. This can help you get more attendees and create a buzz around your upcoming events.
In this article, we will show you how to add a Google Calendar in WordPress, step by step.
Why Add Google Calendar to WordPress?
By adding Google Calendar to WordPress, you can easily show upcoming events to your visitors in a professional and user-friendly calendar layout.
For example, if you run a gym website, then you might add all your fitness classes, free trials, coaching sessions, and other fitness events to the calendar.
When creating an event, you can add all the information visitors need to know.
This might include anything attendees need to bring to the event, whether refreshments are provided, the price, and directions to the venue.
This will help visitors decide whether the event is right for them without having to ask a ton of questions via your site’s contact form. If you make any changes to your Google Calendar, then your website will update automatically, so you’ll also save a ton of time.
That being said, let’s see how to add a Google Calendar to your WordPress website.
Adding Google Calendar in WordPress Using a Plugin
The best way to add a calendar to your WordPress website is by using the Pretty Google Calendar plugin. It is one of the best WordPress calendar plugins and allows you to show events from a public calendar in a mobile-responsive layout.
This means the calendar will look just as good on smartphones and tablets as it does on desktop devices.
The first thing you need to do is install and activate the Pretty Google Calendar plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.
Upon activation, go to Settings » Pretty Google Calendar Settings.
Here, you’ll need to enter a Google API key.
To create this key, head over to the Google Cloud Console. If this is your first time visiting the console, then you’ll need to accept the terms and conditions and choose whether you want to get email updates.
With that done, click on ‘Agree and Continue.’
This takes you to the Google Cloud Console.
We’re going to create a new project for our Google Calendar API, so click on ‘Select a project.’
In the popup that appears, select ‘New Project.’
You can now type in a name for the project. This is just for your reference, so you can use anything you want.
On this screen, you can also add an optional organization to the API key and change the location where Google Cloud Console will create your project.
When you are happy with the information you’ve entered, click on ‘Create.’
After that, select ‘Enabled APIs & Services’ from the left-hand menu and then click on ‘Enable APIs and Services.’
This screen shows all the different APIs you can enable. For example, if you want to show the latest videos from your YouTube channel, then you’ll need to enable the YouTube Data API.
Since we want to add a Google Calendar in WordPress, scroll to the ‘Google Workspace’ section and click on ‘Google Calendar API.’
This takes you to a screen where you can activate the key for managing and changing events in the Google Calendar.
To do this, simply click on the ‘Enable’ button.
With that done, you are ready to create a Google Calendar API key.
In the left-hand menu, click on ‘Credentials’ and then select ‘Create Credentials.’ In the dropdown that appears, you need to click on the ‘API key’ option.
After a few moments, you’ll see an ‘API key created’ popup. You’ll need to add this information to the plugin, so make a note of it.
By default, the Google Calendar API key is unrestricted. To stop other people from using the API key, it’s smart to restrict it by clicking the ‘Edit API Key’ link inside the popup.
This opens a screen showing all your Google API keys. Simply find the key you just created and give it a click.
If you closed the popup by accident, then don’t worry. You can simply select ‘Credentials’ in the left-hand menu and then select the API key you created in the previous step.
Now, scroll to ‘Application Restrictions’ and then click on ‘Websites.’
Under ‘Website Restrictions,’ you need to click on ‘Add.’
In the ‘Add Website’ field, type in your website’s address.
Then, click on ‘Done.’
Under ‘API restrictions,’ you need to select the button next to ‘Restrict key.’
With that done, just click on the ‘Select APIs’ dropdown menu.
In the dropdown, check the box next to ‘Google Calendar APIs.’
Then, simply click on ‘OK.’
With that done, click on ‘Save’ to store your settings.
You are now ready to add the Google Calendar API key to your WordPress website. Switch back to the WordPress dashboard and add the API key to the ‘Google API’ field.
With that done, click on ‘Save Changes’ to store the API key.
How to Make Your Google Calendar Public
Before you can add a Google Calendar in WordPress, you’ll need to change the calendar’s settings to make it public. You also need to get the calendar ID.
To do that, open the Google Calendar that you want to add to your WordPress website. Then, click the ‘Gear’ icon and select ‘Settings’ from the dropdown menu.
In the left-hand menu, find the ‘Settings for my calendars’ section.
Here, click on the name of the calendar that you want to share. This will open up the settings for that specific calendar.
Now, you need to find the ‘Access permissions for events.’
Under this heading, simply check the box next to ‘Make available to public.’
A popup will warn you that these events will be visible to other people and may even appear in the Google search results.
If you are happy to go ahead, then click on ‘OK.’
With that done, scroll to the ‘Integrate calendar’ section and find the ‘Calendar ID.’
You’ll need to use this value in your shortcode, so either make a note of it or leave this screen open in a separate tab.
Adding Your Google Calendar to WordPress
With that done, you are ready to add the Google Calendar to your WordPress blog or website using a shortcode. Simply go to the page or post where you want to show the calendar, and then click on the ‘+’ button.
In the popup, just type in ‘Shortcode’ and then click on the right block when it appears.
Inside the shortcode block, add the following shortcode:
[pretty_google_calendar gcal= “calendar-id”]
You’ll need to replace “calendar-id” with the ID you got in the previous section.
With that done, you can add any other content to the page, such as images, text, and categories and tags. When you are ready to make the calendar live, click on the ‘Publish’ or ‘Update’ button.
Now if you visit your website, you’ll see the Google Calendar in action.
Adding Your Google Calendar to a WordPress Sidebar
Sometimes you may want to promote your events across every page of your WordPress website. To do this, simply add the Google Calendar to any widget-ready area.
This allows visitors to see the calendar and learn about your events from any page of your WordPress website.
To add the Google Calendar to a sidebar or similar section, go to Appearance » Widgets in the left-hand menu.
You can now click on the blue ‘+’ icon.
In the search field that appears, type in ‘Shortcode.’
When the right block shows up, simply click to add it to the sidebar.
You can also drag the Shortcode block to the area where you want to show the calendar.
After that, paste the Pretty Google Calendar shortcode and calendar ID into the block. You can get this information by following the same process described above.
Finally, go ahead and click on the ‘Update’ button. When you visit your WordPress website, you’ll see the Google Calendar live.
If you are using one of the newer block-enabled themes, then you’ll need to add the widget using the full site editor.
To get started, head over to Appearance » Editor in the WordPress dashboard.
In the left-hand menu, choose the template or template part that you want to edit.
For example, you might add the calendar to your site’s sidebar or similar section.
After choosing a template or template part, you can add a shortcode block by following the same process described above.
With that done, add the shortcode and ID for the calendar you want to show.
Finally, click on the ‘Save’ button to make the calendar live.
We hope this article helped you learn how to add Google Calendar in WordPress. You may also want to see our expert picks for the best email marketing services for small businesses or our guide on how to create a contact form in WordPress.