WP Travel is a powerful WordPress tour operator plugin that helps travel and tour agencies create and manage trips, build detailed itineraries, accept online bookings, and process payments with ease.

With WP Travel, you can assign fixed departure dates and trip durations to your trips. Starting from WP Travel v11.1.0, you can now globally block bookings for all trips within a specific date range.

This feature is especially useful when you want to stop bookings during Office closure days, Holidays and Seasonal unavailability.

How the Feature Works

WP Travel introduced a new filter hook: wp_travel_exclude_booking_dates_range_for_all_trips This allows you to exclude a date range from booking availability for all trips. This feature:

  • Works perfectly with Trip Duration
  • For Fixed Departure trips, this currently works only when using Recurring with Calendar Booking

Block Bookings for a Single Date Range

To block bookings between March 25, 2026 and March 29, 2026, use:

add_filter( 'wptravel_exclude_booking_dates_range_for_all_trips', function () {
    return array(
        array(
            '03/25/2026', // start date
            '03/29/2026'  // end date
        ),
    );
});

After adding this code, all trips will be unavailable for booking within the specified date range.

langtang valley trek

Block Bookings for Multiple Date Ranges

You can also block multiple date ranges at once. For example:

add_filter( 'wptravel_exclude_booking_dates_range_for_all_trips', function () {
    return array(
        array(
            '03/25/2026', // start date
            '03/29/2026'  // end date
        ),
        array(
            '04/05/2026', // start date
            '04/07/2026'  // end date
        ),
        array(
            '04/25/2026', // start date
            '04/27/2026'  // end date
        ),
    );
});

After adding this code, bookings will be disabled for all trips within the specified date ranges.

How to Add code

You can add this snippet in either of the following ways:

Using a snippets plugin is safer, as it prevents issues when your theme is updated.

Additionally, if you want to learn more about the filter hook available in the WP Travel plugin, refer to the hook page.You can also learn how to exclude dates for all trips here to set booking blackout periods.

Check the WP Travel documentation to learn more about configurations, modules, payments, and shortcodes.

Your feedback helps us improve. Feel free to share your thoughts!

Need assistance? Contact our support team, join our Facebook community, and subscribe to our YouTube Channel for video tutorials.

You can also find us on Facebook, Instagram, LinkedIn, TikTok, and X. Thank you for choosing WP Travel.

If you are a WP Travel Free user thinking about upgrading to Pro, simply click on the banner below.

Get WP Travel Pro