Doc WordPress WordPress Tricks, Tips & Snippets


Allow registration of new WordPress users without email address

As you know WordPress requires each user to have a unique email address. This is so that the system can make sure each user is unique using the double opt-in mechanism and also to be able to send him system messages like password reset links etc.

But there are definitely circumstances under which it might be necessary to allow registration of users without email address in the backend. For this I found a great snippet on stackexchange which works perfectly:

// This will suppress empty email errors when submitting the user form
add_action('user_profile_update_errors', 'my_user_profile_update_errors', 10, 3 );
function my_user_profile_update_errors($errors, $update, $user) {

// This will remove javascript required validation for email input
// It will also remove the '(required)' text in the label
// Works for new user, user profile and edit user forms
add_action('user_new_form', 'my_user_new_form', 10, 1);
add_action('show_user_profile', 'my_user_new_form', 10, 1);
add_action('edit_user_profile', 'my_user_new_form', 10, 1);
function my_user_new_form($form_type) {
    <script type="text/javascript">
        // Uncheck send new user email option by default
        <?php if (isset($form_type) && $form_type === 'add-new-user') : ?>
        <?php endif; ?>


This code not only removes WordPress requirement for a user to have ANY email address but also the corresponding form validation and the "required" text in the form fields label!



Comments (0) Trackbacks (0)

No comments yet.

Leave a comment

No trackbacks yet.