• Hello everyone, posting here as I am completely out of ideas on how to fix this and would like to desperately regain access to my WP Dashboard. For about the past two days, I’ve been getting the following message when trying to log into WP-Admin:

    “Sorry, you are not allowed to access this page.”

    In an attempt to remedy the issue I’ve already tried the following ideas:

    • Set all folder permissions to 755 thinking it may have been a File Permissions issue.
    • I verified with my server admin that the WP dashboard name and login are correct in WP-Config. I also generated new Auth keys and put them in there, thinking maybe something got messed up.
    • Temporarily deleted .htaccess to see if it’d let me in, so I could just simply make a new one under the Permalinks section.
    • Made a .htaccess file with just the standard default WP text for .htaccess
    • Renamed plugin folder to plugins_deactivated and current theme folder to themes_deactivated to try a conflict test.
    • Created a new admin account via editing the functions file in my theme, thinking I may have had my account’s admin privs taken away. However, I still got the same error message.

    None of these ‘fixes’ reversed the issue and got me into my Admin Dashboard. I’m sure it’s some weird configuration somewhere causing this, but I have no idea where to try and what to ‘edit’ aside from this in an attempt to fix it. Does anyone have any other ideas? I’ve never encountered this issue in the ten years I’ve owned the site. This is all new for me.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The message is generated by WordPress, so changing file permissions or the .htaccess file has little chance of success. It is worrying that even the creation of a new admin via functions.php had no success. What code did you use for this exactly?

    I would still recommend 2 checks:
    a) Have a look in the database. There is a table users in which you should find your admin user. Remember his ID and look in the table usermeta for exactly this. There should be 2 records for this ID with the following meta_keys: capabilities and user_level (each prefixed with your wordpress database prefix). For an admin user_level should have the meta_value 10 and capabilities should be a serialized array with the role “administrator”. Do you have this?
    b) Check the wp-config.php and also the file structure in your project via FTP. Are there any conspicuous entries? Files that do not belong there? My guess would be a hack of the project …

    Thread Starter altwirenet

    (@altwirenet)

    Threadi, thank you for your quick response. For the addition of the admin account, I used the code on the following page:

    https://www.wpbeginner.com/wp-tutorials/how-to-add-an-admin-user-in-wordpress-using-ftp/

    Was this the right code to use or should I try something different?

    I will have my server admin with access to the dashboard, verify what the database info says, and reply back with the findings.

    As for part two of your reply, I’m afraid my reply isn’t very straightforward. I do know that the website has had a bit of a mess with some files that shouldn’t be there that I’ve been trying to remove; however, my WP-Config doesn’t seem to have any out-of-the-ordinary comments in it. My server admin added something on Friday to force an HTTPS redirect, as wp-admin was previously not loading at all and stuck in a 302 redirect loop as it bounced back and forth between HTTP and HTTPS. Could something like that be denying me access? I can’t imagine it would, but then again I am not well versed in WP.

    Yes, the code looks ok and should work as is. A look into the database should confirm this.

    Thread Starter altwirenet

    (@altwirenet)

    Well, as much as I hoped it would give me something to go off of, according to my admin the WP DB had both accounts correct with their permissions and values. Which really doesn’t make sense now, because if I’m indeed an admin, why is it blocking me?

    I can definitely go through and try to delete files that shouldn’t be there, but any other suggestions to look into?

    also make sure the prefix must be same as of your table.

    Means if db tables have the prefix DpA_

    then in db table ‘yourPrefix_usermeta’ both values should be of the same prefix

    Have the same problem in my website, when i login redirects to the website url but not to https://www.yourwebsite.com/wp-admin, if i force to enter here after login get the Sorry, you are not allowed to access this page error, tried a lot of things but cant enter to dashboard, if i login i only see the upper bar of the dashboard and the website as a visitor, but missing left panel and any option to access the dashboard, checked in database wp-usermeta and wp-users are with the right permissions. I dont know what to do more

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Sorry, you are not allowed to access this page. – WP-Admin Error’ is closed to new replies.