18 March, 2023
10 ways to fix the “Sorry, you are not allowed to access this page” error

If you use WordPress, you have probably seen the "Sorry You Are Not Allowed to Access This Page" error at least once. So what exactly is this error, and how do you deal with it? In this article, MONA Media shares the top 10 most effective ways to fix it.
What is the "Sorry You Are Not Allowed to Access This Page" error? What causes it?
In WordPress, this error usually appears when you try to open a part of the site that you don't have permission to access.
As for the causes of this error, theo MONA, the most basic reasons the "Sorry you are not allowed to access this page" error appears are related to:
- Permission problems
- Security problems on the website while it runs
The main cause of this error in WordPress is a setting changed on the site itself, or restoring a backup onto a completely new hosting hosting environment.
When the site shows this error, what you need to do is learn the ways to handle and fix it. That keeps the site running steadily and avoids unwanted interruptions.
How to fix the "Sorry, you are not allowed to access this page" error in WordPress
From many years of fixing technical errors on client websites, MONA has found several approaches worth considering for the "Sorry, You Are Not Allowed to Access This Page" error in WordPress. The main ones are below:
Roll the website back to before the "Sorry, you are not allowed to access this page" error appeared
Rolling the website back to before the error appeared is the first option to consider. Any change could be the cause of the "Sorry, You Are Not Allowed to Access This Page" error, such as a version update or a major PHP change.
Once you know exactly when the site was last changed, you just need to go back to the time before that. In addition,, you can consider using the WP Rollback plugin to restore the old version quickly.
Use WP_DEBUG to get a list of errors
Turning on the WP_DEBUG tool shows you which PHP errors currently exist, and one of them could be the cause that stops you from accessing the site normally. To do this, open the wp-config.php file and add the code that displays debug messages on each site. The results let you pinpoint the cause of the error accurately:
define( ‘WP_DEBUG’, true )
Check the error log
You can also identify the error from the server's error log. Once you know the error, you narrow down the possible causes and can fix the problem faster.
If you cannot find the cause of the "Sorry You Are Not Allowed to Access This Page" error by turning on WP_DEBUG or from your host's error log, MONA suggests checking the error messages from your security plugin.
Collect error information from your security plugin
NThe cause of the "Sorry You Are Not Allowed to Access This Page" error could be an attack or someone trying to hack your site. If a security plugin is already installed, check your inbox and spam folder to find the problem faster.
- Võ Nguyên Thoại – Co-founder/CTO of Mona Host
If you haven't installed any plugin, consider WP Security Audit Log, which collects activity on your WordPress site quickly, in detail and accurately. Activity related to source code and database changes is all recorded, so you can find the cause of the problem in time.
Check file permissions
The "Sorry You Are Not Allowed to Access This Page" error may come from misconfigured file permissions. In this case, follow the method MONA shares below to make sure file permissions are set correctly:
Select Other, then click Fix File Ownership in your hosting control panel. With just a click, the tool detects and fixes permission problems on files and folders automatically, as quickly as possible.
Disable all themes and plugins
Newly installed or newly updated themes and plugins can also cause the "Sorry You Are Not Allowed to Access This Page" error. So you should disable any newly added plugins or themes early. If you cannot get into the admin area, you can do it manually over FTP:
- Rename the theme and plugin folders to another name so they are disabled.
- When you are done, reopen the website and check whether the error is still there.
- If the error is not fixed, re-enable themes and plugins one at a time and check the site each time you enable one.
- Once you find the culprit, disable it or, if possible, delete it from the website completely.
Reset the .htaccess file manually
If the error is still not fixed after the methods above, the problem may be in the code of the .htaccess file. In this case, do the following:
- Go to the public_html folder over FTP and find the .htaccess file.
- When you find it, click Rename and rename the file to .htaccess_backup.
- Right-click again and download the file.
- Open the downloaded file in a text editor or Notepad, rename it back to .htaccess and paste in the default code snippet for WordPress.
- Finally, save the file and upload it to your site. If the cause was the .htaccess file, the error will be fixed.
Check the database prefix
If you have upgraded PHP and the error still appears, the cause may be the database prefix. Reopen the wp-config.php file, then open the WordPress database and check the prefix value in both places to see whether they actually match. If they don't, change wp-config.php so it matches database and you are done.
Upgrade your site to the latest PHP version
A badly outdated PHP version that hasn't been upgraded can also cause the "Sorry, You Are Not Allowed to Access This Page" error in WordPress. In that case, upgrading to the latest version is a reasonable choice.
Before upgrading, though, check that your WordPress site is compatible with it and that you have a backup. After upgrading PHP, test the site to confirm the error is gone.
Export or reset the WordPress site
Before using this fix, you must have a complete backup of your website. Sometimes the WordPress installation itself can cause the "Sorry, You Are Not Allowed to Access This Page" error, so you should export the site into a fresh WordPress installation early.
The last resort is to reset the WordPress site completely. Note that a reset wipes the database entirely and the site's content is gone. If the content has been backed up, though, restoring it after reinstalling WordPress is easy.
In short, The "Sorry, You Are Not Allowed to Access This Page" error directly affects how your website runs. Learning the common fixes for its usual causes is the way to solve it. We hope the information MONA Media shared above is useful to you.
See more:
- Common WordPress errors and how to fix them
- KHow to fix "This site can't be reached"
- How to fix the 500 Internal Server Error
Related articles
Professional website
design services
Own a website with a beautiful, 100% exclusive design and a lifetime warranty, with the ability
to expand features flexibly as your business grows, starting today!































Free AI courses
AI tools at work
VI
EN
