WP Travel is a powerful WordPress travel booking plugin that helps tour operators efficiently manage trips, bookings, and customers. To enhance customer experience and reduce manual support workload, WP Travel includes a Booking Cancellation feature that allows travelers to cancel their bookings directly from the customer dashboard.

When this feature is enabled:
- Overall booking management becomes faster and more efficient
- Customers can manage their own bookings without contacting support
- Admins receive instant email notifications when a booking is canceled
Table of contents
Enable Booking Cancellation for Customers
By default, booking cancellation is disabled for customers. You can enable it using a simple filter hook.
Add the Code Snippet
Add the following snippet to your site:
add_filter( 'wp_travel_enable_canceled_booking_for_customer', function () {
return true;
});
Once enabled, customers will see the option to cancel their booking from the WP Travel dashboard.
Add a Cancellation Time Limit
You can restrict how many days before the travel date a customer is allowed to cancel a booking.
Note: By default, cancellation is not allowed within 7 days of the travel date.
For example, to allow cancellation only up to 15 days before departure, use:
add_filter( 'wp_travel_cancel_booking_days_limit', function( $days, $booking_id, $travel_date ) {
return 15; // Set the cancellation limit to 15 days before the travel date
}, 10, 3 );
Customize the Booking Cancellation Email
WP Travel sends an email notification to the admin when a customer cancels a booking. You can customize this email content to include useful booking details and maintain a professional communication workflow.

Customize Email Content
Use the following code to modify the cancellation email message:
add_filter('wptravel_email_content_for_booking_cancelation',
function ( $message, $traveler_name, $traveler_lname, $booking_id ) {
$message = "
<h2>Custom Booking Cancellation</h2>
<p>Dear Admin,</p>
<p>The following booking has been <strong>successfully canceled</strong>:</p>
<ul>
<li><strong>Customer Name:</strong> {$traveler_name} {$traveler_lname}</li>
<li><strong>Booking ID:</strong> {$booking_id}</li>
</ul>
<p>Please take the necessary action.</p>
";
return $message;
},
10,
4
);
Where to Add These Snippets
You can add the above snippet in one of the following ways:
Method 1: Child Themes functions.php
- Navigate to:
/wp-content/themes/your-child-theme/functions.php - Paste the code snippets at the end of the file
- Save the file
This ensures your customizations are preserved during theme updates.
If you don’t have a child theme yet, refer to our KnowledgeBase guide on How to Create a Child Theme?
Method 2: Using a Code Snippets Plugin
- Install and activate a plugin like Code Snippets
- Go to Snippets → Add New
- Paste the code snippet
- Save and activate the snippet
This method is safe and does not require editing theme files.
Conclusion
By enabling the Booking Cancellation feature, you give travelers more control over their bookings while keeping administrators informed—resulting in a smoother and more professional booking experience.
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.

WP Travel Editorial is a team of WordPress and travel industry experts dedicated to delivering technical resources, travel business guides, and general travel insights. With over 10 years of experience, the team provides in-depth release notes, feature updates, and informative articles to help tour operators and travel enthusiasts succeed in the evolving travel landscape.
From plugin updates and industry trends to practical travel resources, WP Travel Editorial shares valuable content that supports both the travel industry and avid travelers.





