When I try to log in to
wp-admin I get “Sorry you are not allowed to access this site”. I have two copies of my site on my host. One is a ‘test’ version running with Jetpack’s safe mode on. I imported both into Local, but the ‘test’ version does not allow wp-admin. It might be because of safe mode, but I do not know how to switch off safe mode without accessing the admin dashboard. I do not want to disable safe mode on the host and then have to export the site all over again, especially as I cannot confirm this is even the problem.
- Does this happen for all sites in Local, or just one in particular?
- Are you able to create a new, plain WordPress site in Local and access it in a Browser?
Click on the site in Local, click ‘Admin’. Try to sign in. The browser shows the message “Sorry but you are not allowed to access this page”.
That’s definitely odd that it happens only on the test site. Can you try deactivating the plugins or possibly reverting to a default WP theme?
You can do this even without access to the wp-admin by right-clicking on the site in Local and selecting “Open Site Shell.”
From there, a terminal should open, and you can deactivate all the plugins with this command:
wp plugin deactivate --all
It’s possible that there is another reason for this sort of user permission issue – I’ve seen it occasionally with a database that has incorrect data within the user tables, but a good first step is to deactivate those plugins. Let us know how it goes!
I’ve tried disabling the plugins and using a default theme, but no joy. I also tried exporting the whole site again. It does sign in when I click “admin”, but all that shows up is the default WP post. It has the admin bar up top, but when I hover over the dashboard menu, the options don’t unroll like usual. (Actually, this is how it behaved at first after the initial import, but then it started giving the “you can’t access” message.)
I exported my site using the instructions here. I used the
wp-content folder and the exported SQL database. This worked fine for my main site, so I’m not sure what isn’t working with this one. The only differences I can think of that might be salient are:
- Jetpack is in safe mode, because this site is a duplicate of my main site for testing.
- The test site has Divi installed and Divi builder active but the main site does not.
I am going to try exporting the individual pages from the test site, but that won’t include site customizations I made. If you can think of anything more I can try to diagnose, please let me know.
When you say you have two copies of the site on your host, what exactly do you mean?
Does each site have its own database and site root or are they sharing things? For example, is the remote site a WordPress Multisite?
I made a duplicate of my main site on my host so that I could test out changes. It has its own database. I’m not sure what a WordPress Multisite is. I believe they are separate installations of WordPress.
A WordPress Multisite is basically a collection of different “subsites” that all share the same database. It’s a pretty specific installation, and you would know if you had set it up as a multisite. More info can be found in this help doc:
What you’re describing seems like it’s a site-level issue. Maybe there’s a plugin or the theme is causing issues when being imported into Local? If that’s the case, that might interfere with the database being imported and as a result, the correct user permissions wouldn’t be within the DB.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.