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
-
Category
-
Programming languages
Installing Instruction
How to Add Snippets into the functions.php File of the Active Child Theme
- Copy the required code snippet to your clipboard.
- Navigate to WordPress Dashboard > Appearance > Theme File Editor.
- Click the functions.php tab to open the file.
- Paste the code snippet below the existing code in the Selected file content: area.
- 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
-
Category
-
Programming languages