In the ever-evolving digital marketing and SEO landscape, staying ahead of the competition requires more than just great content; it demands optimization techniques that make your website more visible and accessible to search engines.
One such technique is Schema markup. This powerful tool significantly enhances your search engine visibility and improves user engagement by leveraging the power of Rich Snippets (enhanced search results provide additional information beyond the standard link, such as review ratings, product details, recipe information, or event details).
For websites using The Events Calendar plugin, the Events schema markup is automatically added to your event pages. This ensures that your events appear in the most informative and eye-catching way.
In this article, we explore the essentials of schema markup, its importance, and how you can effectively implement it to maximize the impact of your events.
Introduction to Schema Markup
Schema markup, also known as structured data, is a microdata format that helps search engines understand the content of your web pages more effectively. Adding schema markup to your pages improves how search engines represent your page in results, leading to better visibility and higher click-through rates.
Note: While schema markup does not directly affect your search rankings, it can improve your click-through rates (CTR) by making your listings more attractive and informative.
As mentioned, The Events Calendar automatically adds schema markup to your event pages. Let’s dive deeper to learn more about this and which markups our main plugins include.
Schema Markup for The Events Calendar plugin
The event schema markup is automatically added to your calendar view and single event pages using the free Events Calendar plugin.
Let’s look at the required and optional event schema items to understand how it works.
Required Fields
- @context: This is automatically added, always as “https://schema.org“.
- @type: Automatically added as the “Event” type.
- name: The name of the event (Your event post title)
- startDate: The start date and time of the event (in the ISO 8601 date format).
- Location: the event’s location. You can use the Place type for physical locations, which fills in with your Venue data—name and address—so remember to add a venue for your events. Alternatively, use the VirtualLocation type for virtual locations (a feature provided by the Virtual Events plugin).
That said, let’s see an example showing how the JSON-LD schema data appears on your page source code:
<script type="application/ld+json">
[{"@context":"http://schema.org",
"@type":"Event",
"name":"Hosted Dinner with Chef Monica Geller",
"description":"Join Chef Moinca Geller for a Hosted Dinner! She will discuss how her weight loss contributed to her wanting to be a chef all while preparing her guests a healthy, balanced meal for you to enjoy.",
"startDate":"2024-06-15T18:30:00-04:00"
"location":{
"@type":"Place",
"name":"ABC Cooking School Event Center",
"description":"The ABC Cooking School is the best event center of New York",
"address":{
"@type":"PostalAddress",
"streetAddress":"123 1st Aveune",
"addressLocality":"New York City",
"addressRegion":"NY",
"postalCode":"10036",
"addressCountry":"United States"
},
}]
</script>
Optional Fields
- endDate: The end date and time of the event in ISO 8601 date format.
- description: A brief description of the event, automatically filled with your event post content.
- image: URLs of images related to the event. Your Featured Image will be automatically included there.
- eventStatus: The status of your event. When creating your events, the Event Status meta box will automatically set your event as a Scheduled event, but you can change it to “Canceled” or “Postponed” statuses. You can learn more about those statuses on the “Creating Events” article.
- EventAttendanceMode: indicates whether it occurs online, offline, or a mix. All events are automatically set as an Online event. Using the Virtual Events plugin, you can create Online and Mixed events.
- offers: Details about the ticket or entry offer, including price, currency, availability, and URL for purchasing tickets.
The Events Calendar provides a price field where you can set the value and currency. Using the Event Tickets plugin, that field is hidden as that data comes from the tickets created on your event page. - organizer: Information about the organization or person organizing the event, including name and URL. The Events Calendar provides the Organizer post type, where you can create event organizers and select them when creating your events.
Schema Markup for Event Tickets plugin
The Event Tickets plugin enhances your event listings by automatically populating the “offers” field in the Event schema markup. This integration ensures that search engines can display detailed information about ticket availability, prices, and purchasing options directly in search results, improving your event’s visibility and attractiveness to potential attendees.
How It Works
When you add tickets to an event using the Event Tickets plugin, the plugin automatically generates structured data that includes the following key elements in the “offers” field:
- @type: Specifies the type of offer, automatically set to “Offer”.
- url: Provides the URL where users can purchase the tickets (your event/page URL).
- price: Displays the ticket price.
- priceCurrency: Indicates the currency of the ticket price.
- availability: Shows the availability status of the tickets, such as “InStock” or “SoldOut”.
- validFrom: States the date and time the ticket is available for purchase.
This automated process ensures that your event listings are enriched with accurate and up-to-date information, making it easier for users to find and purchase tickets.
Events schema X SEO plugins
The quality of your schema markup implementation plays an important role in optimizing your event-related content for search engines. The Events Calendar and Event Tickets plugins automatically generate and integrate the most effective event schema markup for your events and tickets. This ensures that search engines appropriately index and display your event information, enhancing visibility and user engagement without additional SEO plugins.
While third-party SEO plugins like Yoast SEO or Rank Math offer general schema markup capabilities, they may not be as specialized or comprehensive for events as The Events Calendar. Here’s why:
- General vs. Specific: SEO plugins provide many schema types but may not delve deep into the specifics required for events and tickets.
- Manual Configuration: Configuring event-specific schema markup with SEO plugins often requires additional setup or code customization, whereas The Events Calendar handles this automatically.
- Potential Conflicts: Using multiple plugins to handle schema markup can lead to conflicts and duplicate schema, which may confuse search engines and negatively impact SEO.
Testing your schemas
Google and the schema.org website provide excellent tools to test your published pages:
Additional Snippets
In this section, you will find custom PHP snippets created to answer some support questions we received.
To use those snippets, you can add the PHP snippet to your theme’s functions.php file or use your preferred method for integrating snippets into your WordPress site, such as the free Code Snippets plugin.
Note that all snippets will now include a “class_exist” PHP function to check if the classes declared by each plugin exist. This function detects whether the Events Calendar and other mentioned plugins are enabled. This check ensures that you only run those snippets if those plugins exist on your website, preventing potential issues from declaring a function for something unavailable on your website.
How to disable Yoast SEO schemas for single event URLs
if ( class_exists('Tribe__Events__Main') && class_exists ('WPSEO_Frontend') ) {
function custom_yoast_schema() {
if ( is_singular('tribe_events')){
add_filter( 'wpseo_json_ld_output', '__return_false' );
}
}
add_filter( 'template_redirect', 'custom_yoast_schema' );
}
Filter: wpseo_json_ld_output
How to disable Rank Math schemas for single event URLs
if (class_exists('Tribe__Events__Main') && class_exists('RankMath')) {
function custom_rankmath_schema($data, $jsonld) {
if ( is_singular('tribe_events')){
return [];
}
return $data;
}
add_filter('rank_math/json_ld','custom_rankmath_schema', 99, 2);
}
Filter: rank_math/json_ld
How to disable “All in One SEO”(AIOSEO) schemas for single event URLs
if ( class_exists('Tribe__Events__Main') && class_exists ('AIOSEO') ) {
function aioseo_disable_schema( $disabled ) {
if ( is_singular('tribe_events') ) {
return true;
}
}
add_filter( 'aioseo_schema_disable', 'aioseo_disable_schema' );
}
Filter: aioseo_schema_disable
How to disable The Events Calendar schemas
If you prefer to use a third-party plugin to manage all the schemas, you will need to disable the default schema markup provided by The Events Calendar. For that, you can use the following PHP snippet:
if ( class_exists('Tribe__Events__Main') ) {
// Remove Schema JSON from Calendar view URLS
add_filter( 'tribe_events_views_v2_view_json_ld_markup', '__return_empty_string' );
//Remove Schema JSON from Single Event URLS
add_filter( 'tribe_json_ld_markup', '__return_empty_string' );
}
Filter: tribe_events_views_v2_view_json_ld_markup
Change the “Events” schema type to the “MusicEvent” schema type
If all your events are Music events, you may want to change the default event type to use the MusicEvent schema type.
if ( class_exists('Tribe__Events__Main')) {
add_filter( 'tribe_json_ld_event_object', 'customize_event_json_ld', 10, 3 );
function customize_event_json_ld( $data, $args, $post ) {
// Change event type from "Event" to "MusicEvent"
if ( isset( $data->{'@type'} ) && 'Event' === $data->{'@type'} ) {
$data->{'@type'} = 'MusicEvent';
}
// Remove the default "performer" set as "Organization"
if ( isset( $data->performer ) ) {
unset( $data->performer );
}
// Change the default "Organizer" to be used as "Performer"
if ( isset( $data->organizer ) ) {
$data->performer = $data->organizer;
unset( $data->organizer );
}
// Change the new "performer" type from "Person" to "MusicGroup"
if ( isset( $data->performer ) && 'Person' === $data->performer->{'@type'} ) {
$data->performer->{'@type'} = 'MusicGroup';
}
return $data;
}
}
Filter: tribe__tickets__json_ld__order
Conclusion
Integrating and relying on The Events Calendar’s built-in schema markup ensures accurate representation of your event data in search results, effortlessly enhancing your site’s visibility and user experience.
Additional resources
- Event Schema markup – Official markup docs
- Google Search Central – Event structured data