{"id":1896526,"date":"2019-10-18T13:19:21","date_gmt":"2019-10-18T17:19:21","guid":{"rendered":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/remove-ical-and-google-calendar-links-from-single-event-views\/"},"modified":"2025-08-18T07:12:18","modified_gmt":"2025-08-18T11:12:18","slug":"remove-ical-and-google-calendar-links-from-single-event-views","status":"publish","type":"post","link":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/remove-ical-and-google-calendar-links-from-single-event-views\/","title":{"rendered":"Removing Calendar Links"},"content":{"rendered":"\n<p>The Events Calendar calendar views and single events have multiple export and subscribe links by default\u2014one link that lets you subscribe to your events with Google Calendar, one that exports the event into iCal format (the .ics file format), and links for Outlook Live and Outlook 365.<\/p>\n\n\n\n<p>It&#8217;s not uncommon for site owners to want to hide these subscribe links. There are numerous reasons why you might want to prevent subscribing to one format or another. This article presents multiple options for customizing exactly that behavior.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Getting Started<\/h4>\n\n\n\n<p>For starters, the following screenshot might help clarify one of the options being referred to in this article. The screenshot is of a <strong>single event<\/strong>, which by default will have all of the available <strong>Add to Calendar<\/strong> links visible in the lower-left corner of the event description:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2022\/05\/Screen-Shot-2022-05-25-at-7.15.15-AM.png\" alt=\"Screenshot of Add to Calendar links with subscribe and export options\" class=\"wp-image-1952969\"\/><\/figure>\n\n\n\n<p>This shows the default subscribe links that display on single event views.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-reverting-to-the-download-link\">Reverting to the Download Link<\/h2>\n\n\n\n<p>In order to revert to the old download link, instead of using the new dropdown, add the following filter to your theme&#8217;s functions.php file.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n\/\/ Turns off the new dropdown and just shows the old download link.\nadd_filter( &#039;tec_views_v2_use_subscribe_links&#039;, &#039;__return_false&#039; );\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-global-changes\">Global changes<\/h2>\n\n\n\n<p>The following snippets can be used to remove the Google or iCal links from all of the main calendar views <em>and<\/em> single events.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-removing-the-add-to-google-calendar-link\">Removing the &#8220;Add to Google Calendar&#8221; Link<\/h4>\n\n\n\n<p>To remove just the &#8220;Add to Google Calendar&#8221; link, add the following snippet to your theme&#8217;s functions.php file:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\nadd_filter( &#039;tec_views_v2_subscribe_links_gcal_single_url&#039;, &#039;__return_false&#039;, 10 );\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\" id=\"h-removing-the-add-to-icalendar-link\">Removing the &#8220;Add to iCalendar&#8221; Link<\/h4>\n\n\n\n<p>To hide just the &#8220;Add to iCalendar&#8221; link, add the following snippet to your theme&#8217;s functions.php file:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\nadd_filter( &#039;tec_events_show_ical_link&#039;, &#039;__return_false&#039;, 10 );\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\" id=\"h-removing-the-links-from-all-views\">Removing the links from all views<\/h4>\n\n\n\n<p>To hide <strong>all<\/strong> of the &#8220;subscribe to calendar&#8221; links from the front end, you can use the following snippet:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n\/\/ Hide subscribe box on all event pages\/views.\nadd_filter( &#039;tec_views_v2_subscribe_links&#039;, \n  function( $subscribe_links ) { \n    \/\/ When passed an empty array, the template will bail and not display. \n    return &#x5B;]; \n    }, \n  100 \n);\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\" id=\"h-removing-the-links-from-single-event-views\">Removing the links from single event views<\/h4>\n\n\n\n<p>To hide all of the &#8220;subscribe to calendar&#8221; links from <em>only the single-event front end<\/em>, you can use the following snippet:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n\/\/ Hide subscribe box on single event pages.\nadd_filter(\n\t&#039;tec_views_v2_subscribe_link_visibility&#039;,\n\tfunction( $subscribe_links ) {\n\t\treturn ! is_singular( Tribe__Events__Main::POSTTYPE );\n\t},\n\t100\n);\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\" id=\"h-removing-the-links-from-all-but-single-event-views\">Removing the links from all but single event views<\/h4>\n\n\n\n<p>To hide all of the &#8220;subscribe to calendar&#8221; links from the front end <em>except on single-event views<\/em>, you can use the following snippet:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\nadd_filter( \n    &#039;tec_views_v2_subscribe_links&#039;, \n    function ( $visible ) { \n        if ( ! is_singular( Tribe__Events__Main::POSTTYPE ) ) { \n            return false; \n        } \n\n        return $visible; \n    }, \n    15, \n    1 \n);\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\" id=\"h-removing-view-calendar-link-in-list-view-and-mini-calendar-widgets\">Removing &#8220;View Calendar&#8221; link in List View and Mini Calendar Widgets<\/h4>\n\n\n\n<p>If you\u2019d like to remove the &#8220;View Calendar&#8221; link from these displays, you can do so with a simple customization. We\u2019ve put together a comprehensive guide that walks you through the steps, including the exact snippet you\u2019ll need to add to your site. You can follow the guide <a href=\"https:\/\/staging.theeventscalendar.com\/knowledgebase\/how-to-hide-the-view-calendar-link-in-the-events-calendar-list-and-mini-calendar-widgets\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-calendar-views-only\">Calendar views only<\/h2>\n\n\n\n<p>The following snippet will remove the iCalendar and Google Calendar links from the calendar views. They will remain intact on single event pages.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-removing-a-link-only-on-the-calendar-views\">Removing a link only on the calendar views<\/h4>\n\n\n\n<p>Similarly, if you want to <strong>remove<\/strong> it on the calendar views but <strong>leave it<\/strong> present in the single even view, you&#8217;d use:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\nadd_filter( &#039;tec_views_v2_subscribe_link_gcal_visibility&#039;, function() { return is_single(); }, 10 );\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-single-events-created-with-the-classic-editor\">Single events created with the Classic Editor<\/h2>\n\n\n\n<p class=\"has-background\" style=\"background-color:var(--global-palette8)\"><strong>Note:<\/strong> The following snippets only work with the Classic Editor.<br>(<em>Event \u2192 Settings \u2192 General tab \u2192 Activate Block Editor for Events<\/em> is NOT checked.)<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Removing a link only on the single event view<\/h4>\n\n\n\n<p>To <strong>remove<\/strong> just the &#8220;Add to Google Calendar&#8221; link, and <em>just on the single event view<\/em>, add the following snippet to your theme&#8217;s functions.php file:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\nadd_filter( &#039;tec_views_v2_subscribe_link_gcal_visibility&#039;, function() { return ! is_single(); }, 10 );\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">Adding back the old &#8220;Export to .ics file&#8221; Link<\/h4>\n\n\n\n<p>In versions before The Events Calendar 5.12.0, this was one of the default buttons, but it has been removed in favor of the new subscribe ones. If you would like to bring it back, then this is the code you need:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\nadd_filter( &#039;tec_views_v2_subscribe_link_ics_visibility&#039;, &#039;__return_true&#039;, 20 );\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\">Single events created with the Block Editor<\/h2>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-remove-links-when-using-the-block-editor\">Remove Links when using the Block Editor<\/h4>\n\n\n\n<p>The subscribe links have their separate block in the block editor. The buttons can be hidden separately within the block settings.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2022\/02\/shot_220221_2149311-1024x555.jpg\" alt=\"\" class=\"wp-image-1952093\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-calendar-slugs\">Calendar slugs<\/h2>\n\n\n\n<p>Many of these examples use Google Calendar as the example in the snippet, but you can change the behavior of the other subscribe and export buttons by replacing Google Calendar with another slug. Here are the available slugs:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Google Calendar: <code>gcal<\/code><\/li>\n\n\n\n<li>Apple iCalendar: <code>ical<\/code><\/li>\n\n\n\n<li>iCalendar download: <code>ics<\/code><\/li>\n\n\n\n<li>Outlook 365: <code>outlook-365<\/code><\/li>\n\n\n\n<li>Outlook Live: <code>outlook-live<\/code><\/li>\n\n\n\n<li>Outlook ICS: <code>outlook-ics<\/code><\/li>\n<\/ul>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Events Calendar calendar views and single events have multiple export and subscribe links by default\u2014one link that lets you subscribe to your events with Google Calendar, one that exports the event into iCal format (the .ics file format), and links for Outlook Live and Outlook 365. It&#8217;s not uncommon for site owners to want&#8230;<\/p>\n","protected":false},"author":31,"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,59,1],"tags":[115,23],"stellar-product-taxonomy":[161],"class_list":["post-1896526","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-customizing","category-customizing-resources","category-uncategorized","tag-classic-editor","tag-css","stellar-product-taxonomy-the-events-calendar"],"acf":[],"taxonomy_info":{"category":[{"value":24,"label":"Customizations"},{"value":59,"label":"PHP &amp; Functions"},{"value":1,"label":"Uncategorized"}],"post_tag":[{"value":115,"label":"Classic editor"},{"value":23,"label":"CSS"}],"stellar-product-taxonomy":[{"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":"Guga Alves","author_link":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/author\/gugatheeventscalendar-com\/"},"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":110,"filter":"raw","term_order":"0","cat_ID":24,"category_count":110,"category_description":"","cat_name":"Customizations","category_nicename":"customizing","category_parent":0},{"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},{"term_id":1,"name":"Uncategorized","slug":"uncategorized","term_group":0,"term_taxonomy_id":1,"taxonomy":"category","description":"","parent":0,"count":139,"filter":"raw","term_order":"0","cat_ID":1,"category_count":139,"category_description":"","cat_name":"Uncategorized","category_nicename":"uncategorized","category_parent":0}],"tag_info":[{"term_id":115,"name":"Classic editor","slug":"classic-editor","term_group":0,"term_taxonomy_id":115,"taxonomy":"post_tag","description":"","parent":27,"count":18,"filter":"raw","term_order":"0"},{"term_id":23,"name":"CSS","slug":"css","term_group":0,"term_taxonomy_id":23,"taxonomy":"post_tag","description":"","parent":20,"count":48,"filter":"raw","term_order":"0"}],"_links":{"self":[{"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1896526","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/users\/31"}],"replies":[{"embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/comments?post=1896526"}],"version-history":[{"count":6,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1896526\/revisions"}],"predecessor-version":[{"id":1966508,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1896526\/revisions\/1966508"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/media\/1955565"}],"wp:attachment":[{"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/media?parent=1896526"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=1896526"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=1896526"},{"taxonomy":"stellar-product-taxonomy","embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/stellar-product-taxonomy?post=1896526"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}