If you have no upcoming events on your calendar, by default, you will see the “Latest Past Events” view. We’ve added this view as a way for your site visitors to see events that you’ve previously had rather than an empty calendar.

However, you may prefer to see the current month’s calendar, even if it has no upcoming events. In order to do that, you can add a filter to your site.

The filter

We have filters to disable the “Latest Past Events” view. You can add one of the following snippets to your theme’s functions.php file.

To disable the Latest Past View for all Views:

add_filter(
    'tribe_events_views_v2_show_latest_past_events_view',
    function( $show, $view_slug, $view_object ) {
        // We want to disable them all!
        return false;
    },
    10,
    3
);

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:

add_filter(
    'tribe_events_views_v2_month_show_latest_past_events_view',
    function( $show, $view_slug, $view_object ) {
        // We just want to disable this for the month view!
        return false;
    },
    10,
    3
);

But you may want to disable it for a few and enable it for a few, you can use the “generic” filter to do it like this:

apply_filter(
    'tribe_events_views_v2_show_latest_past_events_view',
    function( $show, $view_slug, $view_object ) {
        // We want to disable for month and photo!
        if (
            'month' === $view_slug
            ||'photo' === $view_slug
        ) {
            return false;
        }

        return $show;
    },
    10,
    3
);

The extension

In addition to the above filters, we also have an extension that includes the option to remove the “Recent Past Events” view. You can find it here.