I have a multisite installation running WP 3.5. My main site and a few other blogs on the network work fine. However, if I register a new user and site, that user gets the “You do not have sufficient permissions to access this page.” error any time they try to visit the admin panel of the site. The front end of the site works properly.
When I look at the user in the Network Admin interface, they are shown to be an admin of that site. If I add the Network Admin to the site, I can view the admin area.
I’ve tried the usual suggestions of disabling and removing all plugins, activating the Twenty Twelve theme and reinstalling the WP core. None of these work. How can I fix this?
I spent several hours of my Saturday looking for this error. I could not find a guide anywhere on the ‘net that described my eventual solution. Here is my solution.
In the WP core, the “You do not have sufficient permissions to access this page.” error is generated at the end of
/wp-admin/includes/menu.php
. Agrep
of my plugin directories also showed that several plugins also could generate this error.Make a backup of
menu.php
, and replace the code inside theif
block on lines 224-227 (as of v3.5) with the following:DON’T Leave this code live on your site unless you are actively debugging! Replace this with the backup
menu.php
if you need to step away for a while.Try to access the admin side again. This error page will tell you a few things:
Pages No Access
array set to1
is not accessible to the user. In my case, all pages were set to1
.User Info
, check to see if the user has the correct roles and capabilities. In my case, the user had a role of10
and the capabilities they should have as an admin.Roles
you will see a list of defined roles for the site. In my case, I had no defined roles. Here was my problem.In my case, I was able to browse my database in phpMyAdmin, and look for the
[WPDB_PREFIX]_[SITENO]_user_roles
entry in the[WPDB_PREFIX]_[SITENO]_options
table. I had changed myWPDB_PREFIX
, but some plugin had created a custom user role and written this with the defaultwp_
prefix. I was able to copy over the entry from a working site into the non-working site. As soon as I did the admin was immediately able to access the site.My install was further complicated because I was using the new blog templates plugin, and my template site also had it’s database corrupted in the same way.
I hope this helps.
As I was migrating from a multisite install, the problem was due to the fact that roles are named based on table names. So I solved my problem when I named option wp_7_user_roles to wp_user_roles.
After going through a few solutions including capabilities -nothing seemed to work. I finally rechecked the size of live wp_usermeta verses localhost wp_usermeta and found that the upload had been chopped and missing some values. I emptied the table and re-uploaded the whole usermeta afresh. WordPress worked straightaway after the upload. – Hope this saves someone time.
I had issues with this as well.
What I wanted was to give one user Admin but remove certain menus from the backend admin side bar.
I removed AAM because it was giving permission problems and used Menu Editor Pro instead. Everything works perfectly.
Of course, this is not the most secure way to go about it, it still allows access to the hidden admin pages my manually typing in the urls, but my client wouldn’t know how to get there anyway so this works.
The permission problem relates to the following tables.
Table [prefix]_usermeta
The rows with the column
meta_key
should reflect the prefix as follows.Table [prefix]_options
The single row with the column
option_name
should reflect the prefix as follows.