Last active
October 11, 2023 11:37
-
-
Save rwkyyy/309ed21255f35ec63c5d0da67c5ecde9 to your computer and use it in GitHub Desktop.
remove autocomplete in checkout for woocommerce
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'woocommerce_checkout_fields' , 'autocomplete_billing_remove', 10, 1 ); | |
function autocomplete_billing_remove( $fields ) { | |
$fields['billing']['billing_last_name']['autocomplete'] = "off"; // State off | |
$fields['billing']['billing_phone']['autocomplete'] = null; // Remove statement | |
return $fields; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If anyone finds this, please keep in mind that some browsers (Chrome, Safari and IE11), do not listen to this dom statement, a "work-around" would be via JS setting the fields as passwords, but still the password managers will pop-up...
jQuery(function($) { jQuery('input[name="billing_phone"]').focus(function(e){ jQuery(this).prop('type', 'new-password'); }); });