Stop WooCommerce checkout fields auto-filling – leave blank
You can stop WooCommerce checkout fields from auto filling by using a Woo filter woocommerce_checkout_get_value, this could be useful in a situation when a logged in user is ordering on behalf of multiple customers.
add_filter( 'woocommerce_checkout_get_value','prefix_return_empty_checkout', 1, 1 ); function prefix_return_empty_checkout(){ $user = wp_get_current_user(); //The user has the "shop_manager" role if ( in_array( 'shop_manager', (array) $user->roles ) ) { return ''; } }
So in the code snippet I am returning blank checkout fields just to the ‘Shop Manager’ role which is provided by WooCommerce, conditionally doing this allows regular Customers the user experience of having the checkout fields auto-fill. To apply for all users just remove the if condition.