In WP Travel, users may encounter an issue where their cart becomes empty when the session expires, typically after 5 minutes of inactivity. This short guide will help you fix the Empty Cart issue.
An empty cart situation can be frustrating for users who require more time to complete their booking. But worry not; you can extend this duration using a hook to prevent the cart from being emptied too quickly.
This solution is particularly useful for users who do not use the inventory feature in WP Travel, as the cart data is cleared when the session expires.
To extend the session expiration time, please add the following code to the functions.php file of your child theme, or you can simply add it through a plugin likeΒ code snippets.
For detailed information regarding how to create a child theme, please refer to our knowledge base.
add_filter( 'wp_session_expiration', function( $expiration ) {
return 24 * 60 * 60; // Extend session to 24 hours (in seconds)
});
This code will ensure the session lasts for 24 hours, preventing the cart from being cleared prematurely.
Conclusion:
By extending the session expiration time in WP Travel, you can fix the empty cart issue caused by the default 5-minute session expiration. This solution ensures that users’ cart items remain intact for a longer period, improving the user experience.
Check WP Travel documentation to learn more about configurations, modules, payments, shortcodes, and the WP Travel Rest API.
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. 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.





