If you want to remove all countries (options) and add only selected or specific country as per your need in the country field (dropdown) under traveler info and billing address form in the checkout page then worry not, WP Travel includes the feature that allows you to use filter code to remove all countries and add only specific country as per your requirement on the Checkout page.

remove all countries
remove all countries

To remove all countries and add only selected countries on the checkout page, you have to add the following given filter code in the functions.php file of your child theme.

function wp_travel_customized_countries( $countries ) {
return array( 
    'AF' => __( 'Afghanistan', 'wp-travel' ),
    'AN' => __( 'Angola', 'wp-travel' ),
    'NZ' => __( 'New Zealand', 'wp-travel' ),
);
}
add_filter( 'wp_travel_country_list', 'wp_travel_customized_countries' );

For detail information regarding how to create a child theme, please refer to our Knowledgebase.

Output

remove all countries

Also, if you want to learn more about the filter hook that is used to remove all countries and add only selected countries on the checkout page, please once refer specific hook page.

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.

Get WP Travel Pro