0

I'm looking for 3 different solutions all relating to user ids, I'm needing a solution to safely make changes without destroying the site.

Issue 1:

  • I am wanting to change the userID of a user from UserID 507 to userID 10.

Issue 2:

  • I am wanting to manually user a deleted UserID, basically the user 5 was deleted by accident and was only noticed two months later and we want to register a user to this userID.

Issue 3:

  • We have a plugin that generates a "temporary account" if someone registers through certain channels and then when they finalize their registration it merges this into a new account so all of our user ID's are separated by 1 user.

  • User 2 = temp/deleted, user 3 = real user, user 4 = temp/deleted, user 5 = real user... etc

  • We want all these blank/non existent user ids to be filled with actual users.


The solution for 1 or 3 could be a solution for 2, either will work. For 1 and 2 I am perfectly fine having as a SQL query.

Any pointers or suggestions on ways to achieve these?

  • 1
    This really isn't how user IDs are supposed to be used. If you need sequential user numbers for business reasons then you should use a separate custom field, and not rely on a database ID. – Jacob Peattie Jul 26 '19 at 3:33
  • Of course it's not how they're supposed to be used, I know that. That doesn't help me in do what I am wanting though. – Ryflex Jul 27 '19 at 12:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.