How can I change the default placeholder for the address?

By default, the address field in the checkout only contains the name „Street“ and the default value „Street name and house number“. Especially if you don’t use any other default values in the fields, the whole thing looks very unclean here. In addition, the house number would also have to be entered as the name.

With the following code in the functions.php, you can solve the problem:

add_filter('woocommerce_default_address_fields', function ($address_fields) {
    unset($address_fields['address_1']['placeholder'], $address_fields['address_2']['placeholder']);
    $address_fields['address_1']['label'] = __('Straße & Hausnummer');
    return $address_fields;
});
Without cookies
This website does not use cookies or tracking. More information can be found in the privacy policy.