How to Create Admin User Manually to Retrieve Hacked WordPress Blog

It happens to WordPress blog very often. Your site got hacked and administrator user has been changed by the hacker. now you cannot login to admin panel. In this situation you must create admin user manually to retrieve hacked WordPress blog. To do that you must have access to site’s hosting control panel. Let’s see how you can create a new user with administrator privilege.

First of all log into your Cpanel and open PhpMyadmin. Then select the database and go to wp_users table and click on insert tab:


We create anew user user101 with password user123456. Do not forget to select the function MD5 in user_pass field and set other field as following:

create-wp-admin-user2Now go to wp_usermeta table and click on insert tab. Then insert the information as follows:


In user_id fields enter the newly created user id, meta_key value enter wp_capabilities and in meta_value filed enter a:1:{s:13:”administrator”;s:1:”1″;} and save it. Then insert another row with following information:


And you are done. You can do the same process with one single SQL query:

INSERT INTO `database_name`.`wp_users` (`ID`, `user_login`,
`user_pass`, `user_nicename`, `user_email`, `user_url`,
`user_registered`, `user_activation_key`, `user_status`,
`display_name`) VALUES (‘105’, ‘user101’, MD5(‘user123456’),
‘Roy’, ‘’, ‘’,
‘2013-10-13 00:00:00’, ”, ‘0’, ‘Roy’);</p>
INSERT INTO `database_name`.`wp_usermeta` (`umeta_id`, `user_id`,
`meta_key`, `meta_value`) VALUES (NULL, ‘105’, ‘wp_capabilities’,
‘a:1:{s:13:"administrator";s:1:"1";}’), (NULL, ‘105’, ‘wp_user_level’, ’10’);

Author: mytutorialguru

Share This Post On

Submit a Comment

Your email address will not be published. Required fields are marked *