{"id":1896503,"date":"2019-10-18T13:19:17","date_gmt":"2019-10-18T17:19:17","guid":{"rendered":"https:\/\/theeventscalendar.com\/knowledgebase\/change-the-text-for-ical-and-google-calendar-export-buttons-2\/"},"modified":"2026-04-22T15:57:22","modified_gmt":"2026-04-22T19:57:22","slug":"customize-subscribe-export","status":"publish","type":"post","link":"https:\/\/theeventscalendar.com\/knowledgebase\/customize-subscribe-export\/","title":{"rendered":"Customizing Subscribe and Export Options"},"content":{"rendered":"\n<p>The Events Calendar lets visitors subscribe to your calendar or export events to their own calendar app through a set of links on calendar views and single event pages. You may want to tweak how those links appear. This article collects common customizations for the display of the Subscribe and Export.<\/p>\n\n\n\n<p>Customizations for The Events Calendar are usually implemented via code snippets or template overrides. Add snippets to your child theme&#8217;s <code>functions.php<\/code> file or use the Code Snippets plugin. Template overrides should go in a child theme. If either approach is new to you, start with <a href=\"https:\/\/theeventscalendar.com\/knowledgebase\/best-practices-for-implementing-custom-code-snippets\/\">Using Code Snippets to Customize The Events Calendar<\/a> and <a href=\"https:\/\/theeventscalendar.com\/knowledgebase\/customizing-template-files\/\">Customizing The Events Calendar Templates<\/a> for a walkthrough of each.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-custom-subscribe-and-export-button-labels\">Custom Subscribe and Export Button Labels<\/h2>\n\n\n\n<p class=\"p1\">Let&#8217;s say you want to change the labels for the&nbsp;Google Calendar, iCal, and Outlook download buttons on a single event page. You&#8217;ve seen them before when looking at one of the events on your site. They pop up just below the content for the event and look a little something like this:<\/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-1.png\" alt=\"Add to calendar buttons\" class=\"wp-image-1952972\"\/><\/figure>\n\n\n\n<p>Here&#8217;s a pretty handy snippet you can add to your theme&#8217;s <code>functions.php<\/code> file to change those labels.<\/p>\n\n\n\n<p>This snippet does the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Changes &#8220;Add to Google Calendar&#8221; to &#8220;Subscribe Here&#8221;<\/li>\n\n\n\n<li>Changes &#8220;Add to iCalendar&#8221; to &#8220;Export Here&#8221;<\/li>\n<\/ul>\n\n\n\n<p>Of course, you can edit the snippet to have those labels say anything you want.<\/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_gcal_label&#039;, \n    function ( $label, $link_obj, $view ) {\n\t\tif ( !is_singular( &#039;tribe_events&#039; ) ) { return $label; }\n        return $link_obj-&gt;get_single_label( $view );\n    },\n    10,\n    3\n);\n<\/pre><\/div>\n\n\n<p>You can also change the labels for the various Outlook options. Simply replace the Google Calendar and iCalendar filters with one of the following:<\/p>\n\n\n\n<p><strong>Outlook 365:<\/strong> <code>tec_views_v2_subscribe_link_outlook-365_visibility<\/code><br><strong>Outlook Live:<\/strong> <code>tec_views_v2_subscribe_link_outlook-live_visibility<\/code><br><strong>Outlook ICS File:<\/strong> <code>tec_views_v2_subscribe_link_outlook-ics_visibility<\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-removing-the-add-to-calendar-option\">Removing the &#8220;Add to Calendar&#8221; Option<\/h2>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-removing-the-option-everywhere\">Removing the Option Everywhere<\/h4>\n\n\n\n<p>To hide <strong>all<\/strong> of the &#8220;add to calendar&#8221; dropdown 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( 'tec_views_v2_subscribe_links', \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-option-from-single-event-pages\">Removing the Option from Single Event Pages<\/h4>\n\n\n\n<p>To hide all of the &#8220;add to calendar&#8221; dropdown 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'tec_views_v2_subscribe_link_visibility',\n\tfunction( $subscribe_links ) {\n\t\treturn ! is_singular( Tribe__Events__Main::POSTTYPE );\n\t},\n\t100\n);\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-remove-select-options-from-the-dropdown\">Remove Select Options from the Dropdown<\/h2>\n\n\n\n<p>If you&#8217;d like, you can customize which links display. Here are some filters that you can add to your theme&#8217;s functions.php file in order to do that.<\/p>\n\n\n\n<p>To remove the Google Calendar link from the dropdown, use this snippet:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\nadd_filter( 'tec_views_v2_subscribe_link_gcal_visibility', '__return_false', 12 );\n<\/pre><\/div>\n\n\n<p>To remove the iCalendar link from the dropdown, use this snippet:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\nadd_filter( 'tec_views_v2_subscribe_link_ical_visibility', '__return_false', 12 );\n<\/pre><\/div>\n\n\n<p>To remove the Outlook 365 link from the dropdown, use this snippet:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\nadd_filter( 'tec_views_v2_subscribe_link_outlook-365_visibility', '__return_false', 12 );\n<\/pre><\/div>\n\n\n<p>To remove the Outlook Live link from the dropdown, use this snippet:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\nadd_filter( 'tec_views_v2_subscribe_link_outlook-live_visibility', '__return_false', 12 );\n<\/pre><\/div>\n\n\n<p>To remove the .ics file download link, use this snippet:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\nadd_filter( 'tec_views_v2_subscribe_link_ics_visibility', '__return_false', 12 );\n<\/pre><\/div>\n\n\n<p>To remove the Outlook .ics file download link, use this snippet:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\nadd_filter( 'tec_views_v2_subscribe_link_outlook-ics_visibility', '__return_false', 12 );\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-rearrange-subscribe-export-options-in-dropdown\">Rearrange Subscribe \/ Export Options in Dropdown<\/h2>\n\n\n\n<p>If you\u2019d like to reorder the subscription options that appear in the <strong>Subscribe<\/strong> dropdown on your calendar (for example, showing <strong>iCal<\/strong> first instead of <strong>Google Calendar<\/strong>), you can do this with a simple snippet.<\/p>\n\n\n\n<p>By default, the calendar sets its own order for subscription options. Some sites may prefer to highlight a specific platform (like iCal) for their audience. With a filter, you can easily adjust which option appears first.<\/p>\n\n\n\n<p>Add the following code to your site. You can place it in your theme\u2019s <strong>functions.php<\/strong> file via <strong>Appearance \u2192 Theme File Editor<\/strong>, or for a safer option, use the <a href=\"https:\/\/wordpress.org\/plugins\/code-snippets\/\">Code Snippets plugin<\/a>.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n\/**\n * Reorder the subscribe links to place iCal first.\n *\n * @param array $subscribe_links An array of subscribe\/export link objects.\n * @return array The reordered array of subscribe\/export link objects.\n *\/\nfunction my_custom_reorder_subscribe_links( array $subscribe_links ): array {\n    $target= null;\n\n    \/\/ Check if the &#039;ical&#039; item exists and remove it from its current position.\n    if ( isset( $subscribe_links&#x5B;&#039;ical&#039;] ) ) {\n        $target= $subscribe_links&#x5B;&#039;ical&#039;];\n        unset( $subscribe_links&#x5B;&#039;ical&#039;] );\n    }\n\n    \/\/ If the &#039;ical&#039; item was found, add it to the beginning of the array.\n    if ( null !== $target) {\n        $subscribe_links = &#x5B; &#039;ical&#039; =&gt; $target] + $subscribe_links;\n    }\n\n    return $subscribe_links;\n}\nadd_filter( &#039;tec_views_v2_subscribe_links&#039;, &#039;my_custom_reorder_subscribe_links&#039;, 10 );\n\n<\/pre><\/div>\n\n\n<p>This will move the <strong>iCal<\/strong> option to the top of the dropdown.<\/p>\n\n\n\n<p>If you\u2019d like to move a different option to the top, simply replace <code>'ical'<\/code> in the snippet with one of these keys:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>gcal<\/code> = Google Calendar<\/li>\n\n\n\n<li><code>outlook-365<\/code> = Outlook 365<\/li>\n\n\n\n<li><code>outlook-live<\/code> = Outlook Live<\/li>\n\n\n\n<li><code>ics<\/code> = ICS<\/li>\n\n\n\n<li><code>outlook-ics<\/code> = Outlook ICS file<\/li>\n<\/ul>\n\n\n\n<p>For example, if you want <strong>Google Calendar<\/strong> to appear first, replace every instance of <code>ical<\/code> with <code>gcal<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-adding-a-custom-google-calendar-button-to-your-site\">Adding a Custom Google Calendar Button to Your Site<\/h2>\n\n\n\n<p>The Events Calendar includes built-in Subscribe and Add to Calendar links on calendar views and single event pages. But sometimes you want a Google Calendar button somewhere else on your site \u2014 inside a blog post, a sidebar, a landing page, or anywhere shortcodes can be used.  This approach creates a link that opens Google Calendar and prompts the user to subscribe to your entire events feed. Once subscribed, new events you publish will appear in their Google Calendar automatically (Google typically syncs every 24 hours).<\/p>\n\n\n\n<p>Your subscribe URL follows this pattern:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nhttps:\/\/www.google.com\/calendar\/render?cid=webcal:\/\/yourdomain.com\/?post_type=tribe_events&amp;ical=1&amp;eventDisplay=list\n<\/pre><\/div>\n\n\n<p>Replace <code>yourdomain.com<\/code> with your actual domain. Keep <code>webcal:\/\/<\/code> at the start of the <code>cid<\/code> parameter \u2014 do not use <code>http:\/\/<\/code> or <code>https:\/\/<\/code> here, or it won&#8217;t work correctly in Google Calendar.<\/p>\n\n\n\n<p>Next, add the button to a page or post<\/p>\n\n\n\n<p><strong>Using the Block Editor:<\/strong> Add a Button block and paste the URL above as its link. Set it to open in a new tab and customize the button text (e.g., &#8220;Subscribe to Calendar&#8221;).<\/p>\n\n\n\n<p><strong>Using raw HTML:<\/strong> Paste this into any HTML block or widget:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: xml; title: ; notranslate\" title=\"\">\n&lt;a href=&quot;https:\/\/www.google.com\/calendar\/render?cid=webcal:\/\/yourdomain.com\/?post_type=tribe_events&amp;ical=1&amp;eventDisplay=list&quot;\n   target=&quot;_blank&quot;\n   style=&quot;display:inline-block; padding:10px 20px; background:#0073aa; color:#fff; text-decoration:none; border-radius:5px;&quot;&gt;\n  Subscribe to Calendar\n&lt;\/a&gt;\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-display-a-single-event-card-with-add-to-google-calendar-button\">Display a Single Event Card with Add to Google Calendar Button<\/h2>\n\n\n\n<p>This approach creates a button that imports one specific event into Google Calendar. It&#8217;s a one-time snapshot \u2014 the event details are baked into the link at the time the user clicks it, so if you later update the event on your site, those changes won&#8217;t sync to the user&#8217;s calendar.<\/p>\n\n\n\n<p><strong>Step 1: Add the Custom Shortcode<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function custom_add_to_calendar_button($atts) {\n    $atts = shortcode_atts(array(\n        'post_id' =&gt; get_the_ID(),\n    ), $atts, 'add_to_calendar');\n\n    $event_id = intval($atts&#91;'post_id']);\n\n    if (!$event_id || get_post_type($event_id) !== 'tribe_events') {\n        return '';\n    }\n\n    $title = get_the_title($event_id);\n    $start = tribe_get_start_date($event_id, false, 'Ymd\\THis');\n    $end = tribe_get_end_date($event_id, false, 'Ymd\\THis');\n    $location = tribe_get_venue($event_id);\n    $description = get_the_excerpt($event_id);\n\n    $google_calendar_url = \"https:\/\/calendar.google.com\/calendar\/render?action=TEMPLATE\" .\n        \"&amp;text=\" . urlencode($title) .\n        \"&amp;dates=\" . $start . \"\/\" . $end .\n        \"&amp;details=\" . urlencode($description) .\n        \"&amp;location=\" . urlencode($location) .\n        \"&amp;sf=true&amp;output=xml\";\n\n    ob_start(); ?&gt;\n    &lt;a href=\"&lt;?php echo esc_url($google_calendar_url); ?&gt;\" target=\"_blank\" class=\"add-to-calendar-button\"&gt;\n        Add to Calendar\n    &lt;\/a&gt;\n    &lt;style&gt;\n        .add-to-calendar-button {\n            display: inline-block;\n            padding: 10px 15px;\n            background-color: #0073aa;\n            color: #fff;\n            text-decoration: none;\n            border-radius: 5px;\n        }\n    &lt;\/style&gt;\n    &lt;?php\n    return ob_get_clean();\n}\nadd_shortcode('add_to_calendar', 'custom_add_to_calendar_button');\n<\/code><\/pre>\n\n\n\n<p><strong>Step 2: Use the Combined Shortcodes<\/strong><\/p>\n\n\n\n<p>You can now use <code>[tribe_event_inline]<\/code> to display a mini event preview, and insert the <code>[add_to_calendar]<\/code> button right below it like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;tribe_event_inline id=\"167\"]\n\n{thumbnail}\n\n{title:linked}\n\nTime: {start_date} @ {start_time} \u2013 {end_date} @ {end_time}\n\n{excerpt}\n\n&#91;\/tribe_event_inline]\n\n&#91;add_to_calendar post_id=\"167\"]\n<\/code><\/pre>\n\n\n\n<p>Make sure to replace <code>167<\/code> with the actual post ID of your event.<\/p>\n\n\n\n<p><strong>Example Output<\/strong>:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"686\" height=\"353\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2025\/04\/Result.png\" alt=\"\" class=\"wp-image-1964912\" srcset=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2025\/04\/Result.png 686w, https:\/\/images.theeventscalendar.com\/kb\/uploads\/2025\/04\/Result-300x154.png 300w\" sizes=\"auto, (max-width: 686px) 100vw, 686px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"772\" height=\"789\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2025\/04\/Google-Edited.jpg\" alt=\"\" class=\"wp-image-1964914\" srcset=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2025\/04\/Google-Edited.jpg 772w, https:\/\/images.theeventscalendar.com\/kb\/uploads\/2025\/04\/Google-Edited-294x300.jpg 294w, https:\/\/images.theeventscalendar.com\/kb\/uploads\/2025\/04\/Google-Edited-768x785.jpg 768w\" sizes=\"auto, (max-width: 772px) 100vw, 772px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-additional-filters\">Additional Filters<\/h2>\n\n\n\n<p>You can also use the following filters to further customize the <strong>subscribe and export behavior<\/strong> with Google Calendar and Outlook:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code>tec_views_v2_single_event_gcal_link_base_url<\/code><\/strong>: allows filtering the base URL used for the single event (import) link<\/li>\n\n\n\n<li><strong><code>tec_views_v2_single_event_gcal_link_parameters<\/code><\/strong>: allows altering the params passed to gCal in the link<\/li>\n\n\n\n<li><strong><code>tec_views_v2_single_gcal_subscribe_link<\/code><\/strong>: allows altering the link itself once params have been added<\/li>\n\n\n\n<li><strong><code>tec_events_ical_outlook_single_event_import_url<\/code><\/strong>: allows altering the Outlook&#8217;s export URL .<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>The Events Calendar lets visitors subscribe to your calendar or export events to their own calendar app through a set of links on calendar views and single event pages. You may want to tweak how those links appear. This article collects common customizations for the display of the Subscribe and Export. Custom Subscribe and Export&#8230;<\/p>\n","protected":false},"author":3,"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":[79],"tags":[115,25,58],"stellar-product-taxonomy":[161],"class_list":["post-1896503","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-snippets","tag-classic-editor","tag-customizations","tag-php","stellar-product-taxonomy-the-events-calendar"],"acf":[],"taxonomy_info":{"category":[{"value":79,"label":"Snippets"}],"post_tag":[{"value":115,"label":"Classic editor"},{"value":25,"label":"Customizations"},{"value":58,"label":"PHP"}],"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":"Jaime Marchwinski","author_link":"https:\/\/theeventscalendar.com\/knowledgebase\/author\/jaimetri-be\/"},"comment_info":0,"category_info":[{"term_id":79,"name":"Snippets","slug":"snippets","term_group":0,"term_taxonomy_id":79,"taxonomy":"category","description":"","parent":0,"count":18,"filter":"raw","term_order":"0","cat_ID":79,"category_count":18,"category_description":"","cat_name":"Snippets","category_nicename":"snippets","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":11,"filter":"raw","term_order":"0"},{"term_id":25,"name":"Customizations","slug":"customizations","term_group":0,"term_taxonomy_id":25,"taxonomy":"post_tag","description":"","parent":0,"count":31,"filter":"raw","term_order":"0"},{"term_id":58,"name":"PHP","slug":"php","term_group":0,"term_taxonomy_id":58,"taxonomy":"post_tag","description":"","parent":20,"count":22,"filter":"raw","term_order":"0"}],"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1896503","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\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/comments?post=1896503"}],"version-history":[{"count":10,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1896503\/revisions"}],"predecessor-version":[{"id":1970063,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1896503\/revisions\/1970063"}],"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=1896503"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=1896503"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=1896503"},{"taxonomy":"stellar-product-taxonomy","embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/stellar-product-taxonomy?post=1896503"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}