Marc Blase

Change WordPress user ID

This is usually needed in order to secure the default admin user which has a user_id of 1.

Run these two mysql queries via your favorite interface.

UPDATE wp_users SET ID = 666 WHERE ID = 1;

then…

UPDATE wp_usermeta SET user_id = 666 WHERE user_id = 1;

Please note: you can use any number you want for the user_id as long as it doesn’t correspond to that of an existing user. I just chose the most metal user_id for this example. 🤘.

Published on February 24, 2022