I am inside a database and there is no users table in it. Is it possible that the site running using WordPress has no users table? Please guide. Thanks.

1 Answer 1


Normally WordPress does not allow you to delete 'super admin' through its dashboard, all other users can be deleted. But in your case I think, its some one who deleted all users from the table directly by accessing your WordPress database via phpmyadmin or so.

Even if there is no users in the site, the site will be running without any problem, but you would not be able to access the dashboard and change contents. Also some sections like author pages etc in the front end will not work because there are no users.

But still you can create a new admin user manually via Phpmyadmin, see this link to know how.

For those looking for a quick hint, here is the SQL query:

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 ('4', 'demo', MD5('demo'), 'Your Name', '[email protected]', 'http://www.test.com/', '2011-06-07 00:00:00', '', '0', 'Your Name');

INSERT INTO `databasename`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '4', '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, '4', 'wp_user_level', '10');

Remember to change the databasename to the database you are working with. Also don’t forget to change the appropriate values.

  • Just a heads up, your 'quick hint' doesn't work if there is no WP_Users table, as the original poster mentioned, which is also what I ran into. What can be added that will create the users table as well?
    – Lee
    Nov 17, 2022 at 11:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.