{"id":1966640,"date":"2025-09-05T07:31:31","date_gmt":"2025-09-05T11:31:31","guid":{"rendered":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/?p=1966640"},"modified":"2025-09-05T07:31:32","modified_gmt":"2025-09-05T11:31:32","slug":"how-to-replace-webcal-with-https-in-ical-links","status":"publish","type":"post","link":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/how-to-replace-webcal-with-https-in-ical-links\/","title":{"rendered":"How to Replace webcal:\/\/ with https:\/\/ in iCal Links"},"content":{"rendered":"\n<p>If you\u2019d prefer to change the default protocol of the <strong>Subscribe to Calendar<\/strong>&#8216;s  iCal option, you can do so with a quick customization.<\/p>\n\n\n\n<p>By default, these links are generated with the <code>webcal:\/\/<\/code> protocol, which is designed for live iCalendar subscriptions. If instead you\u2019d like the link to use <code>https:\/\/<\/code> (so it downloads the <code>.ics<\/code> file directly rather than subscribing), you can override that default with a small code snippet.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-the-filter-to-use\">The Filter to Use <\/h2>\n\n\n\n<p>Add the following snippet to your site:<\/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_feed_url&#039;, &#039;tec_modify_ical_to_https&#039; );\nfunction tec_modify_ical_to_https( $link ) {\n    return str_replace( &#039;webcal:\/\/&#039;, &#039;https:\/\/&#039;, $link );\n}\n\n<\/pre><\/div>\n\n\n<p class=\"has-theme-palette-8-background-color has-background\">This filter updates the URL output in the Subscribe to calendar option, replacing any <code>webcal:\/\/<\/code> reference with <code>https:\/\/<\/code> <\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-how-to-add-the-snippet\">How to Add the Snippet<\/h2>\n\n\n\n<p>There are two common ways to add custom snippets to your WordPress site:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-add-to-your-theme-s-functions-php\">Add to Your Theme\u2019s <code>functions.php<\/code><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>In your WordPress dashboard, go to <strong>Appearance \u2192 Theme File Editor<\/strong>.<\/li>\n\n\n\n<li>Select your active theme.<\/li>\n\n\n\n<li>Open the <code>functions.php<\/code> file.<\/li>\n\n\n\n<li>Paste the snippet above at the bottom of the file, then click <strong>Update File<\/strong>.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-use-a-code-snippet-plugin\">Use a Code Snippet Plugin<\/h3>\n\n\n\n<p>If you prefer to keep custom code separate from your theme, you can install the free <a href=\"https:\/\/wordpress.org\/plugins\/code-snippets\/\">Code Snippets plugin<\/a>. This plugin provides a clean interface to add, manage, and safely enable or disable custom code.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-best-practices\">Best Practices<\/h2>\n\n\n\n<p>Before adding any custom code, we recommend reading our guide on <a href=\"https:\/\/staging.theeventscalendar.com\/knowledgebase\/best-practices-for-implementing-custom-code-snippets\/\">best practices for implementing custom code snippets<\/a>. This will help ensure your site remains stable and easy to maintain.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-final-steps\">Final Steps<\/h2>\n\n\n\n<p>After adding the snippet, clear any caching layers (plugin cache, server cache, or CDN cache) to make sure the new link updates correctly. Then, check your event page to confirm that the iCal link now uses <code>https:\/\/<\/code>.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you\u2019d prefer to change the default protocol of the Subscribe to Calendar&#8216;s iCal option, you can do so with a quick customization. By default, these links are generated with the webcal:\/\/ protocol, which is designed for live iCalendar subscriptions. If instead you\u2019d like the link to use https:\/\/ (so it downloads the .ics file&#8230;<\/p>\n","protected":false},"author":64,"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":[24,59],"tags":[25],"stellar-product-taxonomy":[161],"class_list":["post-1966640","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-customizing","category-customizing-resources","tag-customizations","stellar-product-taxonomy-the-events-calendar"],"acf":[],"taxonomy_info":{"category":[{"value":24,"label":"Customizations"},{"value":59,"label":"PHP &amp; Functions"}],"post_tag":[{"value":25,"label":"Customizations"}],"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":"Jes","author_link":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/author\/jes\/"},"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}],"tag_info":[{"term_id":25,"name":"Customizations","slug":"customizations","term_group":0,"term_taxonomy_id":25,"taxonomy":"post_tag","description":"","parent":0,"count":177,"filter":"raw","term_order":"0"}],"_links":{"self":[{"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1966640","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\/64"}],"replies":[{"embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/comments?post=1966640"}],"version-history":[{"count":4,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1966640\/revisions"}],"predecessor-version":[{"id":1966644,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1966640\/revisions\/1966644"}],"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=1966640"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=1966640"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=1966640"},{"taxonomy":"stellar-product-taxonomy","embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/stellar-product-taxonomy?post=1966640"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}