0

Is there a way to associate multiple email addresses (2) with the same user account?

The goal is for the user to be able to use their company email or personal email to log into a company portal - into the same account.

The quickest solution I thought of was to create 2 separate accounts, use meta fields to create a relationship between them. Then, if someone logs in with a personal account, programatically log them into their primary (company) account. However, this might quickly become unmaintainable with account/password management, etc.

How would you go about implementing this?

1
  • not using WP out of the box, but single sign on plugins might allow for this. Eitherway a user will always have an email in the email column of the user table that is considered primary, no matter what you implement, and the functions/APIs are all built on the assumption of a single email, so if you do achieve this, be mindful of that
    – Tom J Nowell
    Commented Nov 29, 2021 at 18:33

1 Answer 1

1

If you create them programmatically, you could set it up so that all of the usernames are one type of email address (business or personal) and the WP email address field contains the other type.

It's not clear if this would fit your particular use case, but one other login possibility is to integrate single sign-on. That way they could log in with their existing credentials - whether that's something like a work MS Exchange email, or a personal Gmail account, or some other type of account that all your users have in common.

Your Answer

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

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