Within The Events Calendar, there are many links that impact SEO positively. Being a calendar, however, there can be situations where links and even whole pages should not be indexed—an example being month view, which has the ability to paginate nearly infinitely.

To improve SEO, The Events Calendar implements sensible defaults that discourage infinite page crawling by search engine bots – all of the ways that we inject meta tags can be overridden with simple filters.

Approaches to influencing search crawlers

In this section, we’ll talk about the various approaches to influencing search engine crawlers (automated inspection and indexing of a site).

An important thing to keep in mind: Your events should all be reachable in your sitemap.xml, which search engines use to index specific pages. So, if an event view is set as noindex and/or nofollow, the events are still findable via the sitemap.xml.

Month, week, and other similar grid views

Due to the near-infinite nature of these views, we take the stance to add the following noindex, nofollow meta tag to your page’s header.

<meta name="robots" id="tec_noindex" content="noindex, nofollow" />

This tells the search engine crawler to avoid indexing the page and to avoid following links on the page.

Day, list, map, photo, summary, and other similar list-style views

Due to the nature of these views, we don’t need to be as aggressive with blocking everything. Instead, we only insert a meta tag if there are no events on the page. When inserting the meta tag, we use noindex, follow, and add the following tag to the header:

<meta name="robots" id="tec_noindex" content="noindex, follow" />

This tells the search engine crawler to avoid indexing the page, but it can follow links on the page that are not set to nofollow.

How does this impact single event pages (hint: it doesn’t)

We do not inject a noindex, nofollow, or follow meta tag on single event pages. If you wish to add a meta tag of your choosing, you will have to do so through some other means.

Note: we do inject meta tags where appropriate on Organizer and Venue pages, but that can be altered with a filter that we talk about below.

What if my home page is the events page?

We do not inject a noindex, nofollow, or follow meta tag if the main events view is set as the site’s homepage. This approach is non-overridable, so if you wish to add a meta tag of your choosing to your homepage, you will have to do so through some other means.

What about pages with the event shortcodes?

Because shortcode usage is meant for extreme flexibility, we do not inject a noindex, nofollow, or follow meta tag onto pages with event views included via shortcodes. If you wish to add a meta tag to a page with a shortcode, you will have to do so through some other means.

Overriding default SEO approaches

We provide a handful of filters that allow you to prevent or change the meta tag additions on your views.

tec_events_seo_robots_meta_include

This filter allows you to globally change whether the meta tag gets included on pages.

Here’s an example that prevents meta includes.

add_filter( 'tec_events_seo_robots_meta_include', '__return_false' );

Here’s an example that prevents meta includes for the list and day view:

add_filter( 'tec_events_seo_robots_meta_include', function( $do_include, $view ) {

    if ( in_array( $view, [ 'list', 'day' ] ) ) {

        return false;

    }

    return $do_include;

}, 10, 2 );

tec_events_seo_robots_meta_include_$view

This filter allows you to individually change whether the meta tag gets included on specific views.

Here’s an example that prevents the meta from being included in the month view:

add_filter( 'tec_events_seo_robots_meta_include_month', '__return_false' );

Here’s another example that prevents the meta being included on the photo view from Events Calendar Pro:

add_filter( 'tec_events_seo_robots_meta_include_photo', '__return_false' );

tec_events_seo_robots_meta_content

This filter allows you to change the content attribute (i.e. noindex, nofollow) of the injected meta tags.

Here’s an example where we change the week view’s content attribute to noindex, follow:

add_filter( 'tec_events_seo_robots_meta_content', function( $content ) {

    $view = tribe_context()->get( 'view' );

    if ( ! $view ) {

        return $content;

    }

    if ( $view !== 'week' ) {

        return $content;

    }

    return 'noindex, follow';

}, 10, 2 );

tec_events_seo_robots_meta_allowable_post_types

This filter allows you to change the post types that are allowed to have meta tags injected into them. 

Here’s an example where we remove Venues from the list of allowable post types:

add_filter( 'tec_events_seo_robots_meta_allowable_post_types', function( $post_types ) {

    return array_filter( (array) $post_types, static function() {

        return $post_type !== \Tribe__Events__Venue::POSTTYPE;

    } );

}, 10, 2 );