Skip to content

Instantly share code, notes, and snippets.

@rwkyyy
Last active October 11, 2023 11:37
Show Gist options
  • Save rwkyyy/309ed21255f35ec63c5d0da67c5ecde9 to your computer and use it in GitHub Desktop.
Save rwkyyy/309ed21255f35ec63c5d0da67c5ecde9 to your computer and use it in GitHub Desktop.
remove autocomplete in checkout for woocommerce
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;
}
@rwkyyy
Copy link
Author

rwkyyy commented Nov 17, 2020

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'); }); });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment