If you don’t want to display the Last Name field in the traveler info form of the Checkout page then worry not, WP Travel plugin includes the feature that allows you to remove the Last Name field in the traveler info form of the Checkout page using filter code.

before remove last name field

To remove the Last Name field displayed in the traveler info form of the Checkout page, you have to add the following given filter code in the functions.php file of your child theme.

function wp_travel_remove_lastname( $checkout_fields ){
 unset( $checkout_fields['traveller_fields']['last_name'] );
 return $checkout_fields;
}

add_filter('wp_travel_checkout_fields', 'wp_travel_remove_lastname' );

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

Output

after remove last name field

Also, if you want to learn more about the filter hook that is used to remove fields on the checkout page, please once refer specific hook page.

If you have any queries/confusions then please submit it to our Contact page.