Hi @lindagester,
You can disable autocomplete to all fields by adding the following code in your theme’s function.php file.
function user_registration_add_auto_complete( $args, $key, $value ) {
switch ( $key ) {
default:
$args['custom_attributes']['autocomplete'] = 'off';
break;
}
return $args;
}
add_filter( 'user_registration_form_field_args', 'user_registration_add_auto_complete', 10, 3 );
However, if you want to disable for selective fields you can add their key in “case” of switch condition. Key is the field name in your field option of the field in the form builder
function user_registration_add_auto_complete( $args, $key, $value ) {
switch ( $key ) {
case 'user_email':
case 'user_pass':
$args['custom_attributes']['autocomplete'] = 'off';
break;
}
return $args;
}
add_filter( 'user_registration_form_field_args', 'user_registration_add_auto_complete', 10, 3 );
Thanks & Regards!
-
This reply was modified 5 years, 10 months ago by
Rumesh Udash.
-
This reply was modified 5 years, 10 months ago by
Rumesh Udash.