{"id":1952348,"date":"2022-03-18T05:25:08","date_gmt":"2022-03-18T09:25:08","guid":{"rendered":"https:\/\/theeventscalendar.com\/knowledgebase\/?post_type=tribe-knowledgebase&#038;p=1952348"},"modified":"2026-04-06T16:08:50","modified_gmt":"2026-04-06T20:08:50","slug":"google-indexing-events","status":"publish","type":"post","link":"https:\/\/theeventscalendar.com\/knowledgebase\/google-indexing-events\/","title":{"rendered":"Controlling How Google Indexes Your Events"},"content":{"rendered":"\n<p>Sometimes <a href=\"https:\/\/theeventscalendar.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">The Events Calendar<\/a> creates multiple links that are indexed by search engines. This may cause some SEO and performance issues on your website. The good news is that our plugin adds a <em>noindex<\/em> meta tag to your page header if t here&#8217;s no events listed on that page, to block this duplicate content.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-block-duplicate-content\">Block Duplicate Content<\/h2>\n\n\n\n<p>If there are no events for a specific URL that you see multiple links created for, TEC adds the following <em>noindex<\/em> meta tag to your page&#8217;s header:<\/p>\n\n\n\n<p><code>&lt;meta name=\"robots\" content=\"noindex\"&gt;<\/code><\/p>\n\n\n\n<p>You can also block Google and other search engines from crawling undesired\/empty pages by disallowing some URL paths in the&nbsp;<a href=\"https:\/\/developers.google.com\/search\/docs\/advanced\/robots\/intro\" target=\"_blank\" rel=\"noreferrer noopener\">robots.txt<\/a>&nbsp;file.<\/p>\n\n\n\n<p>To achieve that, you can add a robots.txt file to your server&#8217;s root folder or manage it using SEO plugins.<\/p>\n\n\n\n<p>The following parameters will help block some WordPress folders and URLs, and also Events Calendar parameters:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: xml; title: ; notranslate\" title=\"\">\n## For WordPress\n\nUser-agent: *\nDisallow: \/wp-admin\/*\nDisallow: \/wp-login.php\nDisallow: \/wp-includes\/*\nDisallow: \/wp-content\/*\nDisallow: \/trackback\nDisallow: \/feed\nDisallow: *\/comments\nDisallow: ?replytocom*\nDisallow: *\/comments-page-*\nDisallow: *\/trackback\nDisallow: *\/feed\nDisallow: *\/comments\n\nAllow: \/wp-content\/cache\/*\nAllow: \/wp-content\/uploads\/*\nAllow: \/wp-content\/themes\/*\nAllow: \/wp-content\/plugins\/*\nAllow: \/wp-includes\/js\/*\nAllow: \/wp-includes\/css\/*\n\n## For Events Calendar\nDisallow: *post_type=tribe_events*\nDisallow: *hide_subsequent_recurrences=*\nDisallow: *tribe-bar-date=*\nDisallow: *tribe-venue=*\nDisallow: *eventDisplay=*\nDisallow: *eventDate=*\nDisallow: *paged=*\nDisallow: *pagename=*\nDisallow: *shortcode=*\nDisallow: *ical=*\nDisallow: *outlook-ical=*\nDisallow: *related_series=*\nDisallow: *tribe_geofence=*\nDisallow: *tribe_organizer=*\n\nAllow: \/events\/*\nAllow: \/event\/*\n<\/pre><\/div>\n\n\n<p>With the <a href=\"https:\/\/wordpress.org\/plugins\/wordpress-seo\/\" target=\"_blank\" rel=\"noreferrer noopener\">Yoast SEO<\/a> plugin, you can edit your robots.txt file under <em>wp-admin &gt; Yoast SEO &gt; Tools &gt; File editor<\/em>. Read more in their documentation <a href=\"https:\/\/yoast.com\/help\/how-to-edit-robots-txt-through-yoast-seo\/\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>.<\/p>\n\n\n\n<p>Using the <a href=\"https:\/\/wordpress.org\/plugins\/seo-by-rank-math\/\" target=\"_blank\" rel=\"noreferrer noopener\">Rank Math SEO<\/a> plugin, you can edit the robots.txt file under <em>wp-admin &gt; Rank Math &gt; General Settings &gt; Edit robots.txt<\/em>. Documentation <a href=\"https:\/\/rankmath.com\/kb\/how-to-edit-robots-txt-with-rank-math\/\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-remove-indexing-from-recurring-event-occurrences\">Remove Indexing from Recurring Event Occurrences<\/h2>\n\n\n\n<p>If you want to prevent recurring event occurrences from being indexed by Google, you can use this snippet to automatically add a noindex tag for all occurrences.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\nadd_action( &#039;wp_head&#039;, &#039;tec_add_nofollow_to_recurring_events&#039; );\n\n\/**\n * Add &#039;nofollow&#039; to recurring events occurrences\n * \n * @return void\n *\/\nfunction tec_add_nofollow_to_recurring_events() {\n    \/\/ Bail if ECP is not active.\n    if ( ! class_exists( &#039;Tribe__Events__Pro__Main&#039; ) ) {\n\t\treturn;\n    }\n\n    \/\/ Get the post ID.\n    $event_id = get_the_ID();\n\n    \/\/ Bail, if it&#039;s not an event.\n    if ( get_post_type( $event_id ) != &quot;tribe_events&quot; ) {\n\t\treturn;\n    }\n\t\n    \/\/ Bail, if it&#039;s not a single event\n    if ( ! is_single() ){\n        return;\n    }\n\t\/\/ If it&#039;s a recurring event, add the noindex meta tag\n    if ( tribe_is_recurring_event($event_id) ) {\n\t\techo &#039;&lt;meta name=&quot;robots&quot; id=&quot;tec_noindex&quot; content=&quot;noindex, follow&quot; \/&gt;&#039; . &quot;\\n&quot;;\n    }\n}\n<\/pre><\/div>\n\n\n<p>If you&#8217;re looking to have only the first recurrence indexed by Google but not all the subsequent ones, you&#8217;ll need to tweak that code not to include the noindex tag for the first event occurrence.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\nadd_action( &#039;wp_head&#039;, &#039;tec_add_nofollow_to_recurring_events&#039; );\n\n\/**\n * Add &#039;nofollow&#039; to recurring events, except for the first instance.\n * \n * @return void\n *\/\nfunction tec_add_nofollow_to_recurring_events() {\n    \/\/ Bail if ECP is not active.\n    if ( ! class_exists( &#039;Tribe__Events__Pro__Main&#039; ) ) {\n\t\treturn;\n    }\n\n    \/\/ Get the post ID.\n    $event_id = get_the_ID();\n\n    \/\/ Bail, if it&#039;s not an event.\n    if ( get_post_type( $event_id ) != &quot;tribe_events&quot; ) {\n\t\treturn;\n    }\n\t\n    \/\/ Bail, if it&#039;s not a single event\n    if ( ! is_single() ){\n        return;\n    }\n\t\n    if ( tribe_is_recurring_event($event_id) ){\n        \/\/ Get the post object.\n\t    $post = get_post( $event_id );\n\t\n\t    \/\/ Check if the event is the first in the recurrence.\n\t    $is_first = \\TEC\\Events\\Custom_Tables\\V1\\Models\\Occurrence::is_first( $post-&gt;_tec_occurrence );\n\n\t    \/\/ If it&#039;s not the first recurrence, add the noindex meta tag\n\t    if ( !$is_first ) {\n\t\t    echo &#039;&lt;meta name=&quot;robots&quot; id=&quot;tec_noindex&quot; content=&quot;noindex, follow&quot; \/&gt;&#039; . &quot;\\n&quot;;\n\t    }\n    }\n}\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-add-noindex-to-the-legacy-recurring-events-page\">Add noindex to the Legacy Recurring Events Page<\/h2>\n\n\n\n<p>If you&#8217;ve been using The Events Calendar for a while, you may have legacy pages for old recurring events (<code>\/event\/[event-name]\/all<\/code>). That page has been replaced by the Series archive page. The following snippet that adds noindex to this page, since it&#8217;s no longer relevant. You can add it to your functions.php file when using <em>Yoast SEO<\/em>:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\nif(class_exists(&#039;WPSEO_Options&#039;)){ \nadd_filter(&quot;wpseo_robots&quot;, function($robots) {\n\tglobal $wp_query;\n\t\tif ( $wp_query-&gt;tribe_is_recurrence_list &amp;&amp; &#039;all&#039; === $wp_query-&gt;get( &#039;eventDisplay&#039; )) {\n        \treturn &quot;noindex&quot;;\n    \t}\n        return $robots;\n\t});\n}\n<\/pre><\/div>\n\n\n<p>If you are using <em>Rank Math<\/em>, here is the example snippet using the proper filters for that plugin:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\nadd_filter( &#039;rank_math\/frontend\/robots&#039;, function ( $robots ) {\n    global $wp_query;\n    if ( $wp_query-&gt;tribe_is_recurrence_list &amp;&amp; &#039;all&#039; === $wp_query-&gt;get( &#039;eventDisplay&#039; )) {\n        unset( $robots&#x5B;&#039;index&#039;] );\n\t    $robots&#x5B;&#039;noindex&#039;] = &#039;noindex&#039;;\n    }\n    return $robots;\n});\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>Sometimes The Events Calendar creates multiple links that are indexed by search engines. This may cause some SEO and performance issues on your website. The good news is that our plugin adds a noindex meta tag to your page header if t here&#8217;s no events listed on that page, to block this duplicate content. Block&#8230;<\/p>\n","protected":false},"author":84,"featured_media":1955565,"comment_status":"closed","ping_status":"closed","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":[24,40,67,79],"tags":[57,204],"stellar-product-taxonomy":[158,161],"class_list":["post-1952348","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-customizing","category-support-resources","category-recurring-events","category-snippets","tag-performance","tag-seo","stellar-product-taxonomy-events-calendar-pro","stellar-product-taxonomy-the-events-calendar"],"acf":[],"taxonomy_info":{"category":[{"value":24,"label":"Customizations"},{"value":40,"label":"Get Help"},{"value":67,"label":"Recurring Events"},{"value":79,"label":"Snippets"}],"post_tag":[{"value":57,"label":"Performance"},{"value":204,"label":"SEO"}],"stellar-product-taxonomy":[{"value":158,"label":"Events Calendar Pro"},{"value":161,"label":"The Events Calendar"}]},"featured_image_src_large":["https:\/\/images.theeventscalendar.com\/kb\/uploads\/2023\/02\/social-share-1024x538.png",1024,538,true],"author_info":{"display_name":"The Events Calendar Team","author_link":"https:\/\/theeventscalendar.com\/knowledgebase\/author\/the_events_calendar_team\/"},"comment_info":0,"category_info":[{"term_id":24,"name":"Customizations","slug":"customizing","term_group":0,"term_taxonomy_id":24,"taxonomy":"category","description":"","parent":0,"count":51,"filter":"raw","term_order":"0","cat_ID":24,"category_count":51,"category_description":"","cat_name":"Customizations","category_nicename":"customizing","category_parent":0},{"term_id":40,"name":"Get Help","slug":"support-resources","term_group":0,"term_taxonomy_id":40,"taxonomy":"category","description":"","parent":0,"count":18,"filter":"raw","term_order":"0","cat_ID":40,"category_count":18,"category_description":"","cat_name":"Get Help","category_nicename":"support-resources","category_parent":0},{"term_id":67,"name":"Recurring Events","slug":"recurring-events","term_group":0,"term_taxonomy_id":67,"taxonomy":"category","description":"","parent":61,"count":6,"filter":"raw","term_order":"0","cat_ID":67,"category_count":6,"category_description":"","cat_name":"Recurring Events","category_nicename":"recurring-events","category_parent":61},{"term_id":79,"name":"Snippets","slug":"snippets","term_group":0,"term_taxonomy_id":79,"taxonomy":"category","description":"","parent":0,"count":21,"filter":"raw","term_order":"0","cat_ID":79,"category_count":21,"category_description":"","cat_name":"Snippets","category_nicename":"snippets","category_parent":0}],"tag_info":[{"term_id":57,"name":"Performance","slug":"performance","term_group":0,"term_taxonomy_id":57,"taxonomy":"post_tag","description":"Learn all about how you can optimize your calendar's performance with The Events Calendar with these Knowledgebase articles.","parent":0,"count":5,"filter":"raw","term_order":"0"},{"term_id":204,"name":"SEO","slug":"seo","term_group":0,"term_taxonomy_id":204,"taxonomy":"post_tag","description":"","parent":0,"count":4,"filter":"raw","term_order":"0"}],"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1952348","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/users\/84"}],"replies":[{"embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/comments?post=1952348"}],"version-history":[{"count":10,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1952348\/revisions"}],"predecessor-version":[{"id":1968581,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1952348\/revisions\/1968581"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/media\/1955565"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/media?parent=1952348"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=1952348"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=1952348"},{"taxonomy":"stellar-product-taxonomy","embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/stellar-product-taxonomy?post=1952348"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}