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.

Further, if you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on FacebookInstagram, and Twitter.

Additionally, if you have any queries/confusion then please submit them to our Contact page.

create your travel site within minutes by wptravel.io ,buy wptravel pro