Not allowed to access wp-admin in local

What issue or error are you experiencing?

After importing my website, I get the following error when logging in to wp-admin: Sorry, you are not allowed to access this page.


What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc


System Details

  • Local Version: Version 9.2.9+6887

  • Operating System (OS) and OS version: Windows 11


Local Logs

Attach your Local Logs here (Help Doc - Retrieving Local’s Log)

local-logs.zip (18.6 KB)


Security Reminder
Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.

Hi @Knittingand!

This usually happens when you have a security plugin or user management plugin on the site that’s blocking access. You can click on Site Shell in Local, under your site name, and then use WP-CLI to disable a specific plugin or all plugins.

wp plugin deactivate pluginname

or

wp plugin deactivate --all

Thanks. Unfortunately that didn’t work.

I’ve had a good look at all of the fixes I can find this morning and have found:

Disabling the plugins didn’t work, neither disabling in WP-CLI nor renaming the plugin folder so they don’t load.

My table prefixes are set the same in the database and config files.

User info in the database is set to administrator correctly.

I tried adding a new user with the role of administrator and it says the role of administrator does not exist

I have also changed the theme and unfortunately that didn’t work either.

Currently trying this: The case of database prefixes in the users meta-key was also different for me

That didn’t work. I also tried creating a new user with admin rights in wp-cli and it returned an error of wp local role doesn’t exist: administrator

OK final update in case anyone else is having this much trouble. I’ve managed to get into wp-admin!

Fixed the case of the database prefixes in wp_usermeta meta_key

Repaired wp_user_roles by copying from the live website

1 Like

Thank you for sharing the updates and solution here for others @Knittingand! :green_heart:

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.