Exclude Bookings Unavailable on Check-In/Check-Out

This snippet filters booking queries to automatically exclude bookings or apartments that are unavailable on the user-selected check-in and check-out dates. It ensures users see only available options for their chosen period.

Specifications
Exclude Bookings Unavailable on Check-In/Check-Out
21 September, 2025
  • Plugin
    • JetSmartFilters
    • JetBooking
  • Category
    • Booking & Appointments
    • Filters & Search
  • Programming languages
    • PHP
Source code

Installing Instruction

How to Add Snippets into the functions.php File of the Active Child Theme

Attention: Create a site backup before applying any changes to functions.php.

This ensures that you can restore the website if something goes wrong after adding the code snippet.

  1. Copy the required code snippet to your clipboard.
  2. Navigate to WordPress Dashboard > Appearance > Theme File Editor.
  3. Click the functions.php tab to open the file.
  4. Paste the code snippet below the existing code in the Selected file content: area.
  5. Click the "Update File" page.

Example Use Case

Use this snippet whenever you want to dynamically exclude bookings that overlap with unavailable dates. It enhances user experience by showing only options that are bookable for the selected check-in and check-out period.
Applicable scenarios:

  • Vacation rentals / Airbnb-style sites — prevent showing apartments that are already booked during the user’s desired dates.
  • Hotel booking websites — display only rooms available for the entire stay period.
  • Event venue booking — hide venues that are partially booked or unavailable for the selected dates.
  • Travel packages — show only tours or packages available for the selected check-in/check-out.
  • Tour operators — ensure users see only tours fitting their chosen schedule.
Specifications
Exclude Bookings Unavailable on Check-In/Check-Out
21 September, 2025
  • Plugin
    • JetSmartFilters
    • JetBooking
  • Category
    • Booking & Appointments
    • Filters & Search
  • Programming languages
    • PHP
Source code

Let’s build together

Have your own solution?

Came up with a great solution and want to show it to the Crocoblock community?

Request a new feature

Leave a feature request through GitHub, and our developers will consider it