Title: reset users ID except for Admin
Last modified: April 1, 2021

---

# reset users ID except for Admin

 *  Resolved anonymized-14293447
 * (@anonymized-14293447)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/reset-users-id-except-for-admin/)
 * I know you shouldn’t mess with IDs but I have made (failed) quite a few user 
   imports (on site with no users yet) and now I wish to reset the IDs before I 
   make a working import (the next ID would be around 50.000 otherwise). Given that
   Admin has ID 1, is [this tip](https://stackoverflow.com/questions/43162365/reset-wordpress-next-user-id-number)
   any good, or there are better solutions?

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/reset-users-id-except-for-admin/#post-14266100)
 * Changing AUTOINCREMENT after cleaning out the tables? Yes, that should work. 
   Be sure no deleted users are referenced by ID in other tables, such as post author
   or similar. In any case, make a complete backup of the DB before changing anything.
 * FWIW, phpMyAdmin has a GUI for changing AUTOINCREMENT if you find that more appealing
   than doing ALTER TABLE queries.
 *  Thread Starter anonymized-14293447
 * (@anonymized-14293447)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/reset-users-id-except-for-admin/#post-14266289)
 * oh, it’s a new site with no real users, I’m just importing dummy ones, so no 
   risk of cross-referenced IDs 🙂
 *  Thread Starter anonymized-14293447
 * (@anonymized-14293447)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/reset-users-id-except-for-admin/#post-14268702)
 * Well, it didn’t really work (or maybe that’s how autoincrement works) because
   I had another admin with ID 34, and the autoincrement started from that, while
   I was hoping it would fill the positions 2-33 and then from 35 on. But at least
   nothing broke in the database 🙂
    Would it be possible to manually assign ID 
   to the next 33 users, so that I’d fill the gap?
 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/reset-users-id-except-for-admin/#post-14269991)
 * Oh, right. Sorry, I guess I wasn’t very clear on that. You must clear out ALL
   records with IDs greater or equal to the AUTOINCREMENT you want. You cannot auto-
   infill values less than the greatest remaining ID.
 * You’d need to alter the 34 record to have ID 2, which means altering all their
   related user meta and any author IDs, etc. Carefully constructed UPDATE queries
   can do this, but it can be error prone. Alternately, delete the user through 
   WP, then add them back after setting the AUTOINCREMENT. However, in doing so,
   any posts they authored will need to be assigned to someone else. TBH, you should
   settle for starting at 35. It’s a lot better than 50001 🙂

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘reset users ID except for Admin’ is closed to new replies.

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 4 replies
 * 2 participants
 * Last reply from: [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Last activity: [5 years, 2 months ago](https://wordpress.org/support/topic/reset-users-id-except-for-admin/#post-14269991)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
