• Starting last night, I was attempting to login to my WordPress site, and I encountered the following error:

    You do not have sufficient permissions to access this page.

    I’ve seen and tried dozens of tips and suggestions from the forums and other WP troubleshooting sites, but nothing seems to resolve the issue. The site is up, so I don’t think it’s a database connection issue. The site was working fine, so I don’t think anything has changed in the database, but I’m guessing that’s where the issue exists.

    I enabled some additional debugging output on the login screen, and this is what I’m seeing:

    Array
    (
        [Pages No Access] => Array
            (
                [index.php] => 1
                [separator1] => 1
                [edit.php] => 1
                [upload.php] => 1
                [link-manager.php] => 1
                [edit.php?post_type=page] => 1
                [edit-comments.php] => 1
                [edit.php?post_type=portfolio_item] => 1
                [separator2] => 1
                [themes.php] => 1
                [plugins.php] => 1
                [profile.php] => 1
                [tools.php] => 1
                [options-general.php] => 1
                [separator-last] => 1
                [wpseo_dashboard] => 1
                [wp-filemanager/fm.php] => 1
                [wpzoom_options] => 1
            )
    
        [User Info] => WP_User Object
            (
                [data] => stdClass Object
                    (
                        [ID] => 1
                        [user_login] => admin
                        [user_pass] => xxxxxxxxxxxx
                        [user_nicename] => admin
                        [user_email] => [email protected]
                        [user_url] =>
                        [user_registered] => 2014-10-18 02:54:45
                        [user_activation_key] =>
                        [user_status] => 0
                        [display_name] => admin
                    )
    
                [ID] => 1
                [caps] => Array
                    (
                        [administrator] => 1
                    )
    
                [cap_key] => wp_er6c5j_capabilities
                [roles] => Array
                    (
                    )
    
                [allcaps] => Array
                    (
                        [administrator] => 1
                    )
    
                [filter] =>
            )
    
        [Roles] => Array
            (
            )
    
    )

    The database prefix is properly configured in wp_config.php as wp_er6c5j_.

    Here are the other relevant parts of the database:

    From wp_er6c5j_usermeta:

    wp_er6c5j_capabilities
    a:1:{s:13:"administrator";b:1;}

    From wp_er6c5j_options:

    wp_er6c5j_user_roles
    a:5:{s:13:"administrator";a:2:{s:4:"name";s:13:"Administrator";s:12:"capabilities";a:63:{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:15:"wpseo_bulk_edit";b:1;}}s:6:"editor";a:2:{s:4:"name";s:6:"Editor";s:12:"capabilities";a:35:{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:15:"wpseo_bulk_edit";b:1;}}s:6:"author";a:2:{s:4:"name";s:6:"Author";s:12:"capabilities";a:11:{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:15:"wpseo_bulk_edit";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;}}}

    Final note: I’ve already tried disabling all plug-ins, so that doesn’t seem to be the issue. I’ve also run a mysql repair, so I don’t believe that the issue is related to mysql table or database corruption.

    I’d appreciate any assistance you can offer — this one is definitely causing a lot of grief.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Moderator t-p

    (@t-p)

    What happenes if you switched to the UNEDITED default Twenty Fourteen theme WITH ALL plugins OFF

    Thread Starter andrewbecks

    (@andrewbecks)

    Hi Tara – No luck on that. Reverting to the default TwentyFourteen theme showed the site, but I still get the same error when logging in to WP admin. I should mention that there is another admin user getting the exact same results on login (same error).

    Moderator t-p

    (@t-p)

    I enabled some additional debugging output on the login screen

    What is it it? How? where?…

    Thread Starter andrewbecks

    (@andrewbecks)

    In /wp-admin/includes/menu.php, I swapped the following code:

    if ( !user_can_access_admin_page() ) {
    
    	/**
    	 * Fires when access to an admin page is denied.
    	 *
    	 * @since 2.5.0
    	 */
    	do_action( 'admin_page_access_denied' );
    
    	wp_die( __('You do not have sufficient permissions to access this page.') );
    }
    
    $menu = add_menu_classes($menu);

    With

    if ( !user_can_access_admin_page() ) {
       $a = array(
           'Pages No Access' => $_wp_menu_nopriv,
           'User Info' => $current_user,
           'Roles' => $wp_roles->get_names(),
       );
       $s = sprintf("\n<br /><pre>%s</pre>", print_r($a, true));
       do_action('admin_page_access_denied');
       wp_die( __('You do not have sufficient permissions to access this page.'.$s) );
    }
    
    $menu = add_menu_classes($menu);
    Moderator t-p

    (@t-p)

    try MANUALLY re-uploading the wp-includes directory from a fresh download of WordPress.

    Thread Starter andrewbecks

    (@andrewbecks)

    Tara – That worked. You are a lifesaver! I literally cannot thank you enough. I have previously tried re-uploading the wp-admin directory from scratch, but no luck. Reuploading wp-includes totally fixed the issue. Thank you again! (If you’re in the US, have a Happy Thanksgiving.)

    Moderator t-p

    (@t-p)

    You are most welcome ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘New Permissions Errors When Accessing WP Admin’ is closed to new replies.