{"id":1954649,"date":"2022-12-01T09:30:36","date_gmt":"2022-12-01T14:30:36","guid":{"rendered":"https:\/\/theeventscalendar.com\/knowledgebase\/?post_type=post&#038;p=1954649"},"modified":"2026-04-02T16:22:46","modified_gmt":"2026-04-02T20:22:46","slug":"disabling-latest-past-events","status":"publish","type":"post","link":"https:\/\/theeventscalendar.com\/knowledgebase\/disabling-latest-past-events\/","title":{"rendered":"Disabling the &#8220;Latest Past Events&#8221; List"},"content":{"rendered":"\n<p>If you have no upcoming events on your calendar, by default, you will see the &#8220;Latest Past Events&#8221; view. We&#8217;ve added this view as a way for your site visitors to see events that you&#8217;ve previously had rather than an empty calendar.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"594\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2022\/12\/With_Latest_Past_Events-1024x594.png\" alt=\"\" class=\"wp-image-1963796\" srcset=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2022\/12\/With_Latest_Past_Events-1024x594.png 1024w, https:\/\/images.theeventscalendar.com\/kb\/uploads\/2022\/12\/With_Latest_Past_Events-300x174.png 300w, https:\/\/images.theeventscalendar.com\/kb\/uploads\/2022\/12\/With_Latest_Past_Events-768x445.png 768w, https:\/\/images.theeventscalendar.com\/kb\/uploads\/2022\/12\/With_Latest_Past_Events.png 1266w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>However, you may prefer to see the current month&#8217;s calendar, even if it has no upcoming events. In order to do that, you can add a filter to your site.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-the-filter\">The filter<\/h2>\n\n\n\n<p>We have filters to disable the &#8220;Latest Past Events&#8221; view. You can add one of the following snippets to your theme&#8217;s <code>functions.php<\/code> file or by using <a href=\"https:\/\/wordpress.org\/plugins\/code-snippets\/\">Code Snippets<\/a> plugin.<\/p>\n\n\n\n<p>To disable the Latest Past View for all Views:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\nadd_filter(\n    &#039;tribe_events_views_v2_show_latest_past_events_view&#039;,\n    function( $show, $view_slug, $view_object ) {\n        \/\/ We want to disable them all!\n        return false;\n    },\n    10,\n    3\n);\n<\/pre><\/div>\n\n\n<p>There are two approaches for disabling it for one view, the simplest is to use the slug-ified filter. So to disable for just Month View:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\nadd_filter(\n    &#039;tribe_events_views_v2_month_show_latest_past_events_view&#039;,\n    function( $show, $view_slug, $view_object ) {\n        \/\/ We just want to disable this for the month view!\n        return false;\n    },\n    10,\n    3\n);\n<\/pre><\/div>\n\n\n<p>But you may want to disable it for a few and enable it for a few, you can use the &#8220;generic&#8221; filter to do it like this:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\nadd_filter(\n    &#039;tribe_events_views_v2_show_latest_past_events_view&#039;,\n    function( $show, $view_slug, $view_object ) {\n        \/\/ We want to disable for month and photo!\n        if (\n            &#039;month&#039; === $view_slug\n            ||&#039;photo&#039; === $view_slug\n        ) {\n            return false;\n        }\n\n        return $show;\n    },\n    10,\n    3\n);\n<\/pre><\/div>\n\n\n<p>The above snippets will generate an empty display on upcoming events to your views, such as this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"338\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2022\/12\/Disabled_Latest_Past_Events-1024x338.png\" alt=\"\" class=\"wp-image-1963798\" srcset=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2022\/12\/Disabled_Latest_Past_Events-1024x338.png 1024w, https:\/\/images.theeventscalendar.com\/kb\/uploads\/2022\/12\/Disabled_Latest_Past_Events-300x99.png 300w, https:\/\/images.theeventscalendar.com\/kb\/uploads\/2022\/12\/Disabled_Latest_Past_Events-768x253.png 768w, https:\/\/images.theeventscalendar.com\/kb\/uploads\/2022\/12\/Disabled_Latest_Past_Events.png 1268w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">The extension<\/h2>\n\n\n\n<p>In addition to the above filters, we also have an extension that includes the option to remove the &#8220;Recent Past Events&#8221; view. You can find it <a href=\"https:\/\/theeventscalendar.com\/extensions\/the-events-calendar-tweaks\/\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you have no upcoming events on your calendar, by default, you will see the &#8220;Latest Past Events&#8221; view. We&#8217;ve added this view as a way for your site visitors to see events that you&#8217;ve previously had rather than an empty calendar. However, you may prefer to see the current month&#8217;s calendar, even if it&#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,59,79],"tags":[58],"stellar-product-taxonomy":[161],"class_list":["post-1954649","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-customizing","category-php-function-snippets","category-snippets","tag-php","stellar-product-taxonomy-the-events-calendar"],"acf":[],"taxonomy_info":{"category":[{"value":24,"label":"Customizations"},{"value":59,"label":"PHP Functions &amp; Snippets"},{"value":79,"label":"Snippets"}],"post_tag":[{"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":"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":143,"filter":"raw","term_order":"0","cat_ID":24,"category_count":143,"category_description":"","cat_name":"Customizations","category_nicename":"customizing","category_parent":0},{"term_id":59,"name":"PHP Functions &amp; Snippets","slug":"php-function-snippets","term_group":0,"term_taxonomy_id":59,"taxonomy":"category","description":"","parent":24,"count":117,"filter":"raw","term_order":"0","cat_ID":59,"category_count":117,"category_description":"","cat_name":"PHP Functions &amp; Snippets","category_nicename":"php-function-snippets","category_parent":24},{"term_id":79,"name":"Snippets","slug":"snippets","term_group":0,"term_taxonomy_id":79,"taxonomy":"category","description":"","parent":0,"count":76,"filter":"raw","term_order":"0","cat_ID":79,"category_count":76,"category_description":"","cat_name":"Snippets","category_nicename":"snippets","category_parent":0}],"tag_info":[{"term_id":58,"name":"PHP","slug":"php","term_group":0,"term_taxonomy_id":58,"taxonomy":"post_tag","description":"","parent":20,"count":72,"filter":"raw","term_order":"0"}],"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1954649","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=1954649"}],"version-history":[{"count":5,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1954649\/revisions"}],"predecessor-version":[{"id":1968362,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1954649\/revisions\/1968362"}],"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=1954649"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=1954649"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=1954649"},{"taxonomy":"stellar-product-taxonomy","embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/stellar-product-taxonomy?post=1954649"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}