All of a sudden (no recent changes), my blog's admin user can no longer access the admin dashboard.
The login is successful, but it just automatically redirects to /wp-admin/profile.php (and gives the insufficient permissions error on that page)
When I try to manually go to /wp-admin it says "You do not have sufficient permissions to access this page."
I tried disabling all plugins and the same error comes up. I tried using the default wp theme, but the same error comes up.
When I check the main admin user in phpmyadmin, it seems to have all the correct permissions (level 10, admin rights, etc)
Any ideas on what I else I should troubleshoot to fix this issue? Maybe add a new admin user via phpmyadmin (not sure how to do that)?
<strong>EDIT</strong> Update. I was able to add a new admin user directly to the database via phpmyadmin (thanks Daniel!) and even the new admin user gets redirected to profile.php and gets the "You do not have sufficient permissions to access this page." error.
<strong>EDIT NUMBER 2</strong> I tried changing the database version in phpmyadmin to 8204. I went back to wp-admin and it redirected me to the database upgrade screen where it said I had to upgrade the database to continue. I did and the permissions error came back :(
<strong>EDIT NUMBER 3</strong> I've tried reuploading the core wordpress files and the problem still persists
Daniel Yoen answers:
try to add temporary user, paste this sql query to phpmyadmin :
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'), 'Demo Demo', '[email protected]', 'http://www.yourdomain.com/', '2012-01-08 00:00:00', '', '0', 'Demo Demo');
INSERT INTO `databasename`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '4', 'wp_capabilities', 'a:1:{s:13:"administrator";b:1;}');
INSERT INTO `databasename`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '4', 'wp_user_level', '10');
then, login with :
user : demo
pass : demo
hope this help
:-)
Daniel Yoen comments:
Go to your phpmyadmin, browse table wp_options and look : wp_user_roles, replace with this line :
a:5:{s:13:"administrator";a:2:{s:4:"name";s:13:"Administrator";s:12:"capabilities";a:62:{s:13:"switch_themes";b:1;s:11:"edit_themes";b:1;s:16:"activate_plugins";b:1;s:12:"edit_plugins";b:1;s:10:"edit_users";b:1;s:10:"edit_files";b:1;s:14:"manage_options";b:1;s:17:"moderate_comments";b:1;s:17:"manage_categories";b:1;s:12:"manage_links";b:1;s:12:"upload_files";b:1;s:6:"import";b:1;s:15:"unfiltered_html";b:1;s:10:"edit_posts";b:1;s:17:"edit_others_posts";b:1;s:20:"edit_published_posts";b:1;s:13:"publish_posts";b:1;s:10:"edit_pages";b:1;s:4:"read";b:1;s:8:"level_10";b:1;s:7:"level_9";b:1;s:7:"level_8";b:1;s:7:"level_7";b:1;s:7:"level_6";b:1;s:7:"level_5";b:1;s:7:"level_4";b:1;s:7:"level_3";b:1;s:7:"level_2";b:1;s:7:"level_1";b:1;s:7:"level_0";b:1;s:17:"edit_others_pages";b:1;s:20:"edit_published_pages";b:1;s:13:"publish_pages";b:1;s:12:"delete_pages";b:1;s:19:"delete_others_pages";b:1;s:22:"delete_published_pages";b:1;s:12:"delete_posts";b:1;s:19:"delete_others_posts";b:1;s:22:"delete_published_posts";b:1;s:20:"delete_private_posts";b:1;s:18:"edit_private_posts";b:1;s:18:"read_private_posts";b:1;s:20:"delete_private_pages";b:1;s:18:"edit_private_pages";b:1;s:18:"read_private_pages";b:1;s:12:"delete_users";b:1;s:12:"create_users";b:1;s:17:"unfiltered_upload";b:1;s:14:"edit_dashboard";b:1;s:14:"update_plugins";b:1;s:14:"delete_plugins";b:1;s:15:"install_plugins";b:1;s:13:"update_themes";b:1;s:14:"install_themes";b:1;s:11:"update_core";b:1;s:10:"list_users";b:1;s:12:"remove_users";b:1;s:9:"add_users";b:1;s:13:"promote_users";b:1;s:18:"edit_theme_options";b:1;s:13:"delete_themes";b:1;s:6:"export";b:1;}}s:6:"editor";a:2:{s:4:"name";s:6:"Editor";s:12:"capabilities";a:34:{s:17:"moderate_comments";b:1;s:17:"manage_categories";b:1;s:12:"manage_links";b:1;s:12:"upload_files";b:1;s:15:"unfiltered_html";b:1;s:10:"edit_posts";b:1;s:17:"edit_others_posts";b:1;s:20:"edit_published_posts";b:1;s:13:"publish_posts";b:1;s:10:"edit_pages";b:1;s:4:"read";b:1;s:7:"level_7";b:1;s:7:"level_6";b:1;s:7:"level_5";b:1;s:7:"level_4";b:1;s:7:"level_3";b:1;s:7:"level_2";b:1;s:7:"level_1";b:1;s:7:"level_0";b:1;s:17:"edit_others_pages";b:1;s:20:"edit_published_pages";b:1;s:13:"publish_pages";b:1;s:12:"delete_pages";b:1;s:19:"delete_others_pages";b:1;s:22:"delete_published_pages";b:1;s:12:"delete_posts";b:1;s:19:"delete_others_posts";b:1;s:22:"delete_published_posts";b:1;s:20:"delete_private_posts";b:1;s:18:"edit_private_posts";b:1;s:18:"read_private_posts";b:1;s:20:"delete_private_pages";b:1;s:18:"edit_private_pages";b:1;s:18:"read_private_pages";b:1;}}s:6:"author";a:2:{s:4:"name";s:6:"Author";s:12:"capabilities";a:10:{s:12:"upload_files";b:1;s:10:"edit_posts";b:1;s:20:"edit_published_posts";b:1;s:13:"publish_posts";b:1;s:4:"read";b:1;s:7:"level_2";b:1;s:7:"level_1";b:1;s:7:"level_0";b:1;s:12:"delete_posts";b:1;s:22:"delete_published_posts";b:1;}}s:11:"contributor";a:2:{s:4:"name";s:11:"Contributor";s:12:"capabilities";a:5:{s:10:"edit_posts";b:1;s:4:"read";b:1;s:7:"level_1";b:1;s:7:"level_0";b:1;s:12:"delete_posts";b:1;}}s:10:"subscriber";a:2:{s:4:"name";s:10:"Subscriber";s:12:"capabilities";a:2:{s:4:"read";b:1;s:7:"level_0";b:1;}}}
n :backup your database before doing this :-)
[[LINK href="http://ghaoui.com/blog/2011/12/wp-solve-you-do-not-have-sufficient-permissions-to-access-this-page/"]]Sources[[/LINK]]
Rodney Blackwell comments:
For the record, the issue was fixed by following a link on your "Sources" page. The first suggestion on that page was to visit http://markjaquith.wordpress.com/2006/03/28/wordpress-error-you-do-not-have-sufficient-permissions-to-access-this-page/ which ended up having the fix.
Arnav Joy answers:
try adding new user with admin rights
see this link for your help
http://www.wpbeginner.com/wp-tutorials/how-to-add-an-admin-user-to-the-wordpress-database-via-mysql/
or try this
https://github.com/NomikOS/Recover-admin-privileges-in-Wordpress/blob/master/wp-get-admin.php
Arnav Joy comments:
read this
http://beconfused.com/2007/how-to-solve-you-do-not-have-sufficient-permissions-to-access-this-page-in-wordpress/
Arnav Joy comments:
if you are still unable to access , then take full back up of your site files + db then reinstall wordpress
Naveen Chand answers:
Using phpMyAdmin, Change your <strong>db_version </strong>in the <strong>wp_options</strong> table to <strong>8204</strong>.
Many who faced similar problem said that this worked for them (in a [[LINK href="http://wordpress.org/support/topic/sudden-you-do-not-have-sufficient-permissions-to-access-this-page-error"]]discussion[[/LINK]] in wordpress forums).
Hope this works for you too.