• Resolved SJW

    (@whitsey)


    I am importing a user list from Joomla.

    We use the “user_id” in Joomla as their member number which gets printed on member cards.

    I want to import this and use it as the ID on wp_users.

    I created a field called ‘ID’ in my spreadsheet but it didn’t import the user… Interestingly, it created all the relevant usermeta records with the user_id = the user_id from the file…

    I’m assuming this is not possible to manually assign the user_id and not use the auto-increment from mysql?

    https://wordpress.org/plugins/import-users-from-csv/

Viewing 1 replies (of 1 total)
  • This plugin cannot do what you want, as the API does not allow the user id to be pre-determined or changed. You should be able to import it as metadata and then use SQL to change the WP user id to match, but there are several possible problems that I do not have time to research. You would need to change the ID in the correct order so as to not have any duplicate IDs – perhaps by first adding a large number (e.g. 10000) to all exist IDs, and then reassigning them back to the desired number. Keep in mind that each step will require all the associated / linking ID numbers to be changed to match (such as in wd_usermeta and “_edit_last” entries in wd_postmeta)

    I think you would be better off keeping the member number as meta data and forget using the internal number. Much easier to change the routine for printing of the member cards!

Viewing 1 replies (of 1 total)
  • The topic ‘How to update user_id’ is closed to new replies.