• I’ve run into an odd problem with users on one of the websites we manage. This particular site is using SSO and an imported database table to populate user information with the wp_login hook. The SSO plugin doesn’t always get everything copied over when users first login and sometimes their information can change, so it checks and updates every time they log in.

    The whole process is working as it should, but we have noticed recently that some users are showing in WordPress with the email address field empty. I did some investigating, and their email addresses are in the wp_users table correctly, but WordPress is ignoring them for some reason. If I enter the email address into the edit user screen, it saves, but the information in the database is exactly the same. I’m kind of lost on what to check for here. It’s something that’s only become a problem recently and isn’t affecting all users, I’m just not sure how to get WordPress to recognize that the email addresses are actually out there. Has anyone else ever seen anything like this happen?

    • This topic was modified 2 years, 3 months ago by Jan Dembowski.
Viewing 4 replies - 1 through 4 (of 4 total)
  • @tabytharourke Your best bet is to ask in a support forum for the SSO plugin you’re using since it may be a configuration issue or bug. However, to add my own experience using an SSO plugin, I had a similar issue where users were created in WordPress from SSO and added invalid characters in the username. (eg, firstname.lastname) . Though it was saved, it created issues in other functionality, and I needed to create a fix for the issue so the user accounts would work properly.

    I’m wondering if something similar is happening with email addresses. I’d recommend comparing the email address that should have been added with the user accounts that weren’t added properly and see if anything stands out, such as common characters or spacing that could be problematic. Again, it’s probably something specific to the SSO plugin, but I wanted to mention my experience.

    Thread Starter tabytharourke

    (@tabytharourke)

    The problem isn’t actually with the data the SSO plugin is pulling in though, it’s with the data that the wp_login hook function is running. The email address is updated there, and from what I can tell, there aren’t any special characters. The email addresses are formatted like firstname.lastname, but that hasn’t been a problem until recently (and it’s accepting them if they are entered directly).

    Yeah, that’s a strange one. After re-reading your original question, the only thing I can think that might cause this would be characters in a different encoding that looks correct at first glance but is actually different characters stored. Otherwise, if the email address is stored in the database in the user table and it’s the same exact one you manually enter (which subsequently works), I’m not sure what would cause this.

    Something else you could try tracing the code to where it’s trying to use that email address in wp_login and see if it’s pulling from anywhere different than the users table (maybe some user meta overriding things?) or bringing the value in incorrectly.

    Thread Starter tabytharourke

    (@tabytharourke)

    Just in case this is something someone runs into in the future, I was able to sort this out by running wp_update_user to update the email addresses instead of putting them directly in the database using a $wpdb query, so I’m wondering if it was some sort of encoding issue.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Users with Empty Email Addresses’ is closed to new replies.