I am trying to reduce the amount of PII (personally identifiable information) that my site collects.

When a user registers an account, by default, that email address is saved twice in the users_field_data table-- once to the mail column, and again to the init column. This may be useful for some sites, but as far as I know core never uses the init value for anything, and so I would like to prevent any value being saved to init.

1 Answer 1


Looking into this, the initial email is only collected automatically if the user registers using the registration form; decoupled registrations do not have init set.

I know the general recommendation is not to patch core, but in this case it's a single line:

diff --git a/core/modules/user/src/RegisterForm.php b/core/modules/user/src/RegisterForm.php
index 0a4da2dcf1..cf2fdd159b 100644
--- a/core/modules/user/src/RegisterForm.php
+++ b/core/modules/user/src/RegisterForm.php
@@ -81,7 +81,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
     $form_state->setValue('pass', $pass);
-    $form_state->setValue('init', $form_state->getValue('mail'));
+    // $form_state->setValue('init', $form_state->getValue('mail'));
     parent::submitForm($form, $form_state);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.