• Resolved webrightnow

    (@webrightnow)


    My site’s frontend works fine, but I can’t log into the admin at all. When entering my correct details at mysite.com/wp-admin, I get redirected to the homepage. If I then type mysite.com/wp-admin back into the address bar, I get error:
    “Sorry, you are not allowed to access this page.”
    I have tried all suggested solutions:
    1. Disabled all plugins, both by removing the plugins by FTP and also via phpMyadmin (option_value a:0:{} under active_plugins)
    2. Reverted to TwentySixteen theme both by removing the custom theme in FTP and also via phpMyadmin (option_value twentysixteen under template and stylesheet). Homepage now loads TwentySixteen theme ok.
    3. Cleared browser cookies and even tried different browsers, with cookies disabled.
    4. Checked that the administrator role is present in wp-options database table (it is).
    5. Cloned whole site by FTP/phpMyadmin onto a different hosting server and domain, in case it was to do with php or other server settings. No difference.
    6. Changed my user’s email address in database and then used password reset to have a new password sent.
    7. Replaced Authentication Unique Keys and Salts in wp-config.php to forcefully log out all users (in case of hacking).
    8. Deleted wp-admin folder and replaced it with a copy from a working site.
    9. Deleted .htaccess and replaced it with a copy from a working site.
    10. Enabled wp_debug in wp-config.php, no php errors showing.
    11. No other errors showing in error_log.
    I appear to be completely out of options. I have no recent backup of the site so I can’t roll back to a time when the admin login worked. I haven’t logged in for a few months and at least one automatic update has happened since. I am guessing that’s what caused the problem, but how do I go about fixing it? Or is it now literally just a case of re-installing WP from scratch and re-importing all the content table by table? Because without admin access I can’t even use the export tool. Please help!

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Check final one, as you are admin or not?

    Can you please share your screenshot for better understanding

    Thread Starter webrightnow

    (@webrightnow)

    I now solved this in the following way:

    – I created a new admin user in the database
    – I logged in to admin no problem with the new username
    – To my surprise, I found that my original user’s role was showing as “None”. I am not sure how this happened, is it possible the recent update corrupted the database tables, or could it be a hack? Once I changed the role back to “admin”, I was able to log in as my old user, so I delete the new one which is no longer needed.

    I am still confused as to how this happened and I’d quite like to know for future reference, but I’m relieved to be back in.

    It’s not happened, please check if you install any admin role permission or user management plugins

    Thread Starter webrightnow

    (@webrightnow)

    There is WordPress Access Control plugin installed, but I disabled all plugins when I was trying to regain access and it made no difference. Can a plugin permanently change a user’s role, even after the plugin itself is disabled?

    Sorry I don’t know about that plugin, may be that change the user role on database when it’s active state

    Thread Starter webrightnow

    (@webrightnow)

    Hi Honggi,

    best to google it, plenty of step by step guides on how to do that:

    https://www.wpbeginner.com/wp-tutorials/how-to-add-an-admin-user-to-the-wordpress-database-via-mysql/

    You need to have access (and some basic understanding) of PhpMyadmin.

    Good luck!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Admin login error: Sorry, you are not allowed to access this page’ is closed to new replies.