October 12, 2017 Design 0

Did you ever have the need of creating a new WordPress user with admin user, and you don’t have the login details for the current Wp admin? Well the good news is that you can easily create a new user with admin role just with pure SQL code. Simply add your database name, username, wp_prefix, and password below, then copy-paste the code in phpMyAdmin code editor, run it, and there you go – you have a new admin in your WordPress website.

Database name:

Wp table prefix:



Cpy paste the code from below:

INSERT INTO `db_name`.`wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) VALUES ('999999999', 'admin_2', MD5('pass123'), 'Your Name', 'test@yourdomain.com', 'http://www.test.com/', '2011-06-07 00:00:00', '', '0', 'Your Name');

INSERT INTO `db_name`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '999999999', 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}');

INSERT INTO `db_name`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '999999999', 'wp_user_level', '10');