My options table crashed and I did successfully repair it. But now when I login in it redirects to home page with no toolbar, and if I type in /wp-admin I get "Sorry, you are not allowed to access this page."

I have tried the usual, disabling plugins and themes. deleting .htaccess file. Nothing seems to work. I did have a DB backup from a 5 days ago that restores access but many changes were made in that time period, so I am hoping to resolve this issue a different way.


I think you have lost your Admin Privileges. Please run following SQL query and login to WP Admin using newly created WP ADMIN.

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', 'test@yourdomain.com', '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');    

New Temporary Admin Details that you can delete later :

Username : demo
Password : demo

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.