How To Fix The “Sorry, You Are Not Allowed To Access This Page” Error In WordPress

you are not allowed to access this page

You woke up in the morning and suddenly see ‘Sorry, you are not allowed to access this page’ error in WordPress site of yours. What will you do?

This error may spoil your morning and you might not be able to solve the error with basic tries. This error may occur due to different reasons and it is very much difficult for beginners to troubleshoot it. 

In this post, I am going to show you how to fix ‘Sorry, you are not allowed to access this page’ error in WordPress. 

Let’s begin. 

Fix ‘Sorry, You Are Not Allowed To Access This Page’ Error

1. Try To Restore Your Website To A Previous Version

The simplest and one of the fastest ways to return to your earlier version of WordPress is to restore your website. A recent update or change might have caused the error. Therefore undoing that change will allow you to get back to your previous site. 

You can either restore your website from your hosting where some hosting provides you a backup solution. Otherwise, you have to make sure you install a backup plugin and create backups first. Then restore your website to the previous state. 

2. Disable All Of Your Plugins

Any plugin error can cause ‘Sorry, You Are Not Allowed To Access This Page’ error. Therefore you should disable plugins one by one. Then check if the problem is resolved. Of course, you are locked out and you cannot access your dashboard. 

To disable plugins you will have to access your site using an SFTP client such as Filezilla. Once you have managed to access your website via SFTP navigate to wp-content and search for plugins folder.

Enter the folder and rename the recently added plugin to ‘plugin-old’. Then go back to your website and see if the error has been resolved. If not, change the name of the plugin back and repeat this process for the next plugin. 

3. Check For A Corrupt .htaccess File

If you are the admin of the page still seeing the error ‘Sorry, you are not allowed to access the page’ then it could be caused by a corrupt .htaccess file. We can check this file by renaming it. 

Like earlier enter your website using the FTP client or file manager feature of your hosting account. 

Now navigate to the root folder containing all your WordPress files. Now search for .htaccess file and rename it to .htacces.old. 

Now try logging into your website and see if the problem has been fixed. If it hasn’t fixed the problem rename the .htaccess.old to .htaccess and move on to the next step. 

4. Check For Incorrect File Permission

While you are in your FTP client, make sure there is no problem with file permissions. File permissions control who access files and folders on your website. The settings below are recommended for most of the users:

755 for all folders and subfolders and 644 for all files. 

Using FTP client or file manager, navigate to the root folder of your WordPress files and select the wp-admin, wp-content, and wp-includes folders. Now right-click and choose ‘Change permissions’. 

Now enter 755 in the Numeric valued field. If you have options, then place a tick on’Recuse into subdirectories’ and then select ‘apply to directories only’.

Now the file permissions dialog box will appear, and this time enter 644 on numeric value. Then if you have options, click on ‘Recurse into subdirectories’ and choose ‘Apply to files only’. 

Click on Ok button. Once you have done this, log out from your WordPress website and then log in again. If this doesn’t solve the error then try to move on to the next step.  

5. Activate Default Theme

If file permission didn’t help then try activating the default theme. To activate the default theme, login to your site using FTP or file manager. Then navigate to wp-content folder. 

Here, you will find a folder named themes. In this folder WordPress keeps all the themes installed on your website. Right-click on the folder and rename it to ‘theme.old’. 

This will activate the default theme. Now check again if the error has been fixed. If not look for the next step. 

6. Look For Changes In Your wp-config.php File

It is possible that your wp-config.php file is misconfigured or hacked by someone. Therefore it is wise to check wp-config.php file. 

You can access this file using SFTP or file manager. Open the wp-config.php file from your root folder and check for anything that seems not right. However, this process can be done easily if you have some kind of change detecting of file integrity monitoring feature in place. 

7. Troubleshoot As Required

If your problem is still not solved then it’s very unfortunate, but do not lose hope. Here are a few more things that you may try. 

Upgrade to the latest version of PHP: Old version of PHP can cause you this error and some other errors too. Therefore it is wise to upgrade your PHP version to the latest one. 

To upgrade to the latest version of PHP you may contact your hosting provider. 

Check error log: if you don’t have any clue, you may check the error log. Your hosting provider might be keeping logs or you might have previously set WordPress to keep an error log. 

Contact Your Hosting Provider: If all the tries didn’t solve your problem then this is the last step. You should contact your hosting provider and ask for their support. They will provide you with excellent technical support and may be able to solve your problem. 

Final Words

Generally for the ‘Sorry, you are not allowed to access this page’ error you won’t have to come this far. One or step two will be enough to solve this problem unless you are unfortunate. Taking all the steps will surely fix the error, but if you cannot do it in the right way it is best to ask for experts help or technical help from your hosting provider. 

If you liked the post then please share it with your friends. And do not forget to share your thoughts in the comment box below.

Leave a Comment

Your email address will not be published.