When creating bookings on your travel website, controlling how users select the number of travelers (Pax) is important for accuracy and ease of use. WP Travel provides filters that let you disable manual input and set custom increment steps, giving you full control over the Pax field on your booking forms. Using these simple code snippets, you can make the booking process smoother and prevent invalid inputs.
WP Travel allows you to control how the Pax (Traveler Count) input behaves on the booking form using filters. With these simple code snippets, you can:
- Disable manual typing in the Pax input field
- Set a custom increment value (e.g., increase pax by 2 instead of 1)
Follow the steps below to implement these customizations.
1. Disable Manual Pax Input
If you want users to select the number of travelers only through the β+ / ββ buttons (and prevent them from typing manually), add the following filter:
add_filter( 'wp_travel_set_pax_input_disable', function(){
return true;
} );
What this does:
- Disables manual keyboard entry in the pax field
- Ensures pax can only be changed via increment/decrement buttons
- Helps avoid invalid pax inputs during booking
2. Change the Pax Increment Value
To make the Pax field increase or decrease by a custom number (e.g., steps of 2), use this filter:
add_filter( 'wp_travel_set_pax_increment_by', function(){
return 2; //Change this number to any value you want
} );
What this does:
- Sets the Pax increment step (default in this example is 2)
- Useful for group bookings or paired travel requirements
- You can change the
return 2;value to any number to fit your booking needs
Where to Add These Snippets
You can add the above snippet in one of the following ways:
1. Child Themeβs functions.php File
- Navigate to:
/wp-content/themes/your-child-theme/functions.php - Paste the code snippet at the end of the file
For step-by-step guidance, refer to our KnowledgeBase article on how to create a child theme.
2. Using a Code Snippets Plugin
- Install and activate a plugin like Code Snippets
- Create a new snippet and paste the code above
- Save and activate the snippet
Important: Always avoid placing custom code in your parent theme to prevent losing changes during updates.
Check WP Travel documentation to learn more about configurations, modules, payments, and shortcodes.
Your feedback helps us improve. Please 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.






