{"id":1958534,"date":"2023-11-08T12:32:09","date_gmt":"2023-11-08T17:32:09","guid":{"rendered":"https:\/\/dev.theeventscalendar.com\/knowledgebase\/?p=1958534"},"modified":"2025-03-17T14:49:28","modified_gmt":"2025-03-17T18:49:28","slug":"improving-seo-with-the-events-calendar","status":"publish","type":"post","link":"https:\/\/dev.theeventscalendar.com\/knowledgebase\/improving-seo-with-the-events-calendar\/","title":{"rendered":"Improving SEO with The Events Calendar"},"content":{"rendered":"\n<p>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\u2014an example being month view, which has the ability to paginate nearly infinitely.<\/p>\n\n\n\n<p>To improve SEO, The Events Calendar implements sensible defaults that discourage infinite page crawling by search engine bots &#8211; all of the ways that we inject meta tags can be overridden with simple filters.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-approaches-to-influencing-search-crawlers\">Approaches to influencing search crawlers<\/h2>\n\n\n\n<p>In this section, we\u2019ll talk about the various approaches to influencing search engine crawlers (automated inspection and indexing of a site).<\/p>\n\n\n\n<p><strong>An important thing to keep in mind:<\/strong> 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 <em>noindex<\/em> and\/or <em>nofollow<\/em>, the events are still findable via the sitemap.xml.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-month-week-and-other-similar-grid-views\">Month, week, and other similar grid views<\/h3>\n\n\n\n<p>Due to the near-infinite nature of these views, we take the stance to add the following noindex, nofollow meta tag to your page\u2019s header.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>&lt;meta name=\"robots\" id=\"tec_noindex\" content=\"noindex, nofollow\" \/&gt;<\/code><\/code><\/pre>\n\n\n\n<p>This tells the search engine crawler to avoid indexing the page and to avoid following links on the page.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-day-list-map-photo-summary-and-other-similar-list-style-views\">Day, list, map, photo, summary, and other similar list-style views<\/h3>\n\n\n\n<p>Due to the nature of these views, we don\u2019t need to be as aggressive with blocking <em>everything<\/em>. Instead, <strong>we only insert a meta tag <\/strong>if there are<strong> no events <\/strong>on the page. When inserting the meta tag, we use <em>noindex, follow<\/em>, and add the following tag to the header:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>&lt;meta name=\"robots\" id=\"tec_noindex\" content=\"noindex, follow\" \/&gt;<\/code><\/code><\/pre>\n\n\n\n<p>This tells the search engine crawler to avoid indexing the page, but it can follow links on the page that are not set to <em>nofollow<\/em>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-how-does-this-impact-single-event-pages-hint-it-doesn-t\">How does this impact single event pages (hint: it doesn\u2019t)<\/h3>\n\n\n\n<p>We <strong>do not inject <\/strong>a <em>noindex<\/em>, <em>nofollow<\/em>, or <em>follow<\/em> 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.<\/p>\n\n\n\n<p><em>Note: we <\/em><strong><em>do<\/em><\/strong><em> inject meta tags where appropriate on Organizer and Venue pages, but that can be altered with a filter that we talk about below.<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-what-if-my-home-page-is-the-events-page\">What if my home page is the events page?<\/h3>\n\n\n\n<p>We <strong>do not inject<\/strong> a <em>noindex<\/em>, <em>nofollow<\/em>, or <em>follow<\/em> meta tag if the main events view is set as the site\u2019s 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.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-what-about-pages-with-the-event-shortcodes\">What about pages with the event shortcodes?<\/h3>\n\n\n\n<p>Because shortcode usage is meant for extreme flexibility, we <strong>do not inject<\/strong> a <em>noindex<\/em>, <em>nofollow<\/em>, or <em>follow<\/em> 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.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-overriding-default-seo-approaches\">Overriding default SEO approaches<\/h2>\n\n\n\n<p>We provide a handful of filters that allow you to prevent or change the meta tag additions on your views.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-tec-events-seo-robots-meta-include\">tec_events_seo_robots_meta_include<\/h3>\n\n\n\n<p>This filter allows you to globally change whether the meta tag gets included on pages.<\/p>\n\n\n\n<p>Here\u2019s an example that prevents meta includes.<\/p>\n\n\n\n<p><code>add_filter( 'tec_events_seo_robots_meta_include', '__return_false' );<\/code><\/p>\n\n\n\n<p>Here\u2019s an example that prevents meta includes for the list and day view:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>add_filter( 'tec_events_seo_robots_meta_include', function( $do_include, $view ) {\n\n&nbsp;&nbsp;&nbsp;&nbsp;if ( in_array( $view, &#91; 'list', 'day' ] ) ) {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return false;\n\n&nbsp;&nbsp;&nbsp;&nbsp;}\n\n&nbsp;&nbsp;&nbsp;&nbsp;return $do_include;\n\n}, 10, 2 );\n\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-tec-events-seo-robots-meta-include-view\">tec_events_seo_robots_meta_include_$view<\/h3>\n\n\n\n<p>This filter allows you to individually change whether the meta tag gets included on specific views.<\/p>\n\n\n\n<p>Here\u2019s an example that prevents the meta from being included in the month view:<\/p>\n\n\n\n<p><code>add_filter( 'tec_events_seo_robots_meta_include_month', '__return_false' );<\/code><\/p>\n\n\n\n<p>Here\u2019s another example that prevents the meta being included on the photo view from Events Calendar Pro:<\/p>\n\n\n\n<p><code>add_filter( 'tec_events_seo_robots_meta_include_photo', '__return_false' );<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-tec-events-filter-wp-robots-meta-directives\">tec_events_filter_wp_robots_meta_directives<\/h3>\n\n\n\n<p>This filter allows you to change the content attribute (i.e. <em>noindex, nofollow<\/em>) of the injected meta tags.<\/p>\n\n\n\n<p>Here\u2019s an example where we change the week view\u2019s content attribute to <em>noindex, follow<\/em>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>add_filter( 'tec_events_filter_wp_robots_meta_directives', function( $robots ) {\n\t\t\n\t\t    $view = tribe_context()->get( 'view' );\n\t\t\n\t\t    if ( ! $view ) {\n\t\t\n\t\t        return $robots;\n\t\t\n\t\t    }\n\t\t\n\t\t    if ( $view !== 'week' ) {\n\t\t\n\t\t        return $robots;\n\t\t\n\t\t    }\n\t\t    \n\t\t\t$robots&#91;'noindex'] = true;\n\t\t\t$robots&#91;'nofollow'] = false;\n\t\t\n\t\t    return $robots;\n\t\t\n\t\t}, 10 );\n\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-tec-events-seo-robots-meta-allowable-post-types\">tec_events_seo_robots_meta_allowable_post_types<\/h3>\n\n\n\n<p>This filter allows you to change the post types that are allowed to have meta tags injected into them.&nbsp;<\/p>\n\n\n\n<p>Here\u2019s an example where we remove Venues from the list of allowable post types:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>add_filter( 'tec_events_seo_robots_meta_allowable_post_types', function( $post_types ) {\n\n&nbsp;&nbsp;&nbsp;&nbsp;return array_filter( (array) $post_types, static function() {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return $post_type !== \\Tribe__Events__Venue::POSTTYPE;\n\n&nbsp;&nbsp;&nbsp;&nbsp;} );\n\n}, 10, 2 );\n\n\n\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>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\u2014an 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&#8230;<\/p>\n","protected":false},"author":31,"featured_media":1955565,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_swpsp_post_exclude":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"ep_exclude_from_search":false,"footnotes":""},"categories":[59],"tags":[204],"stellar-product-taxonomy":[],"class_list":["post-1958534","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-customizing-resources","tag-seo"],"acf":[],"taxonomy_info":{"category":[{"value":59,"label":"PHP &amp; Functions"}],"post_tag":[{"value":204,"label":"SEO"}]},"featured_image_src_large":["https:\/\/images.theeventscalendar.com\/kb\/uploads\/2023\/02\/social-share-1024x538.png",1024,538,true],"author_info":{"display_name":"Guga Alves","author_link":"https:\/\/dev.theeventscalendar.com\/knowledgebase\/author\/gugatheeventscalendar-com\/"},"comment_info":0,"category_info":[{"term_id":59,"name":"PHP &amp; Functions","slug":"customizing-resources","term_group":0,"term_taxonomy_id":59,"taxonomy":"category","description":"","parent":24,"count":101,"filter":"raw","term_order":"0","cat_ID":59,"category_count":101,"category_description":"","cat_name":"PHP &amp; Functions","category_nicename":"customizing-resources","category_parent":24}],"tag_info":[{"term_id":204,"name":"SEO","slug":"seo","term_group":0,"term_taxonomy_id":204,"taxonomy":"post_tag","description":"","parent":0,"count":11,"filter":"raw","term_order":"0"}],"_links":{"self":[{"href":"https:\/\/dev.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1958534","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dev.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dev.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dev.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/users\/31"}],"replies":[{"embeddable":true,"href":"https:\/\/dev.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/comments?post=1958534"}],"version-history":[{"count":5,"href":"https:\/\/dev.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1958534\/revisions"}],"predecessor-version":[{"id":1964677,"href":"https:\/\/dev.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1958534\/revisions\/1964677"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dev.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/media\/1955565"}],"wp:attachment":[{"href":"https:\/\/dev.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/media?parent=1958534"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dev.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=1958534"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dev.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=1958534"},{"taxonomy":"stellar-product-taxonomy","embeddable":true,"href":"https:\/\/dev.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/stellar-product-taxonomy?post=1958534"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}