Best SEO and PPC Tool - Extended Free Trial  GO!
How to Fix the ‘Sorry, You Are Not Allowed to Access This Page’ Error in WordPress

How to Fix the ‘Sorry, You Are Not Allowed to Access This Page’ Error in WordPress

Last modified: December 8, 2020

FAQ
Cloudways

There are some situations which are really worrying when you’re a website owner. One of those is when you are locked out of your own WordPress website and you’ve encountered the message ‘Sorry, You Are Not Allowed To Access This Page’ when you’re trying to log in. This is different to other access problems we’ve discussed before here.

So, here are some potential solutions to this specific problem.

Restore a Previous Version

If you’re regularly backing up your website, which you should be, then you can try to restore your site to a previous version. A recent change, like a WordPress update, new plugin, theme update or something else might be causing the error.

Restoring a previous version could solve the problem. If it does, then you should consider using a staging site to check future updates/new additions to your website.

Disable Plugins

Another option is to disable all the plugins on your website. To do this, you need to access your WordPress website’s FTP and then go to the wp-content and then change the name of the plugins folder to something like ‘plugins_old’ and then change it back to ‘plugins’. This will automatically disable all the plugins.

If the problem goes away then a plugin was causing a problem. You can activate each plugin, one-by-one to find out which one was causing the problem. When you found the problem. Deactivate it through the FTP file by changing the name of the plugin folder in the ‘plugins’ folder. Then delete the plugin from your website.

You can also do this with your theme. You can always change to a default theme by deactivating your current themes folder. Deactivating themes is the same process as the plugins, just change the name of the ‘themes’ folder to ‘themes_old’ and then rename it.

Make sure you’re an Administrator

Make sure that your user role has been changed. This could have been done by accident or through a hacking attempt. You can check your user role in the phpMyAdmin and the wp_users table. If you’ve got the right privileges, then you should see this in the meta_value row:

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

If there is something else there, then you can change it. We’ve discussed this in a previous article.

Check the Database Prefix is Correct

Every MySQL database has a prefix. You need to make sure that the database prefix is correct for your website. The prefix can be changed if you’ve recently migrated your website or through some changes you’ve made to the database.

The database prefix in phpMyAdmin should match that which is listed wp-config.php. So, you can check those carefully.

Look for Changes within the wp-config.php File

Always look for changes within the configuration file. If you’ve been editing the file recently, a change to the file can sometimes cause an error that has caused you to be locked out. If you find that your wp-config.php file has something wrong with it, then you can always correct that error.

Upgrade to the Latest Version of PHP

If you’re running an outdated version of PHP on your website, then this could be the source of all the troubles. Even if your site’s problem isn’t solved by this, upgrading your PHP will improve the overall security and performance of your website.

Be sure that you backup your website. This can be done manually or you can use a plugin.

Change File Permissions

Sometimes the error can be caused by the file permissions on your website being changed. Changing your file permissions is an easy process that we’ve written about before here.

Create a New .htaccess File

If none of the options above work, then access your website’s FTP. Then you can rename the .htaccess file with something like .htaccess_new. Then you can download the file. Open the document in a text editor and replace all of the content with:

#BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCOnd %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
#END WordPress

You can then rename the file as .htaccess and upload it to your serve. This can solve the problem.

Final Solution

If nothing else has worked, then you might need to reset your WordPress website. Then you can reinstall all the software and start again on your website.

Final Word: How to Fix the “Sorry, You Are Not Allowed to Access This Page” Error in WordPress

Are you struggling with accessing your website, check the solutions above. These should solve your website problem. There are lots of options above, you need to go through each one at a time.

Save 4 Later
Email liked links to yourself