Simple commands to insert a new Admin user into your WordPress database:

INSERT INTO `databasename`.`wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) VALUES (‘3’, ‘username’, MD5(‘password’), ‘Nice Name’, ‘’, ‘’, ‘2011-06-07 00:00:00’, ”, ‘0’, ‘Your Name’);

INSERT INTO `databasename`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, ‘3’, ‘wp_capabilities’, ‘a:1:{s:13:”administrator”;s:1:”1″;}’);

INSERT INTO `databasename`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, ‘3’, ‘wp_user_level’, ’10’);


3 – next free user id in wp_users table
username – username logging in with
password – password logging in with
Nice Name – name – email address – URL
2011-06-07 00:00:00 – sign-up date
Your name – display name

Last 2 INSERT commands give the user admin privileges. Remember to update ‘3’ to the user id you set in the first INSERT command.

Written by Matt Cooper
Hi, I'm Matt Cooper. I started this blog to pretty much act as a brain dump area for things I learn from day to day. You can contact me at: