How to Fix ‘Sorry, You are Not Allowed to Access this Page’ Error?

How to Fix ‘Sorry, You are Not Allowed to Access this Page’ Error?

There are some critical situations when you are being locked out of your own WordPress website admin dashboard. And if you have a similar situation and receiving ‘Sorry, you are not allowed to access this page’ error, this simply means a permissions is setting that’s blocking you from a certain area. In this guide we will tell you how to fix it.

‘Sorry, you are not allowed to access this page’ error simply means there is a discrepancy between the website files and the database. Data on the page you’re seeking to access can be inappropriate because of a recent change in WordPress, a faulty plugin, or an outdated theme. 

Fix “You are Not Allowed to Access this Page” Error

Before starting the troubleshooting process, create a website backup. This will help you to restore the website if something goes wrong while troubleshooting. 

Revert your latest changes

Revert you changes - You are Not Allowed to Access this Page

If you simply identify what you did just ere the WordPress Sorry, You Are Not Allowed to Access This Page error popped up, it is quite possible that it was caused by this action. For example, updating from one WordPress version to another can cause database problems that may drive to the error.The simplest way to resolve this problem is by reverting your website manually to a previous version.

Try WP_Debug

WP_Debug - Fix “You are Not Allowed to Access this Page”

The WP_Debug tool can reveal all the PHP errors that are occurred on your website. Navigate to wp-config.php and copy & paste this line of code:

define( ‘WP_DEBUG’, true );

Save the file and you will be able to view a comprehensive record of debug messages when you access your site again. You can now see which message triggered the WordPress Sorry, You Are Not Allowed to Access This Page error and fix it subsequently.

Review your access and error log

Review you access and error log - Fix WordPress errors

Likewise using the WP_Debug tool, you can also check the access and error logs of the server itself. These logs are more specific, and they can assist you stop additional guesswork. See your hosting provider’s documentation on how to find your server’s access and error logs. Normally, they are saved in the /var/log directory, but this can change among different hosts.

Check Plugin Security Notification

Check Plugin Security Notification

If you’ve got plugin security notifications that you neglected at the time, they might be the reason behind this WordPress ‘Not Allowed to Access This Page’ error. Check your latest and old emails twice to see whether you have to update your plugins or not. Don’t neglect your spam folder either.

Check the file permissions

Check the file permissions - You are not allowed to access this page

Another reason for this eeror can be the incorrect file permissions. You need to use an FTP program and the specifications provided by your web host. Find the public HTML folder and look for the wp-admin and wp-content subfolders. Highlight the folders, right-click them, and select the right permission properties suggested by WordPress.

Deactivate your themes/plugins

Deactivate your themes/plugins

Another possibility is that this error can be caused by themes or plugins. If the theme is broken, access your server using an FTP program and go to the themes folder, located in wp-content. Rename the folder and refresh the broken page. If the problem is resolved, the theme you are using is the reason behind the error.

Reset the .htaccess file

Reset the .htaccess file - Fix “You are Not Allowed to Access this Page” Error

Using an FTP program, navigate to the .htaccess file in the root WordPress directory. Download and keep a copy of the file securely on your system. After that, you can edit the file back to its defaults, save it, and then re-upload it to the server. Now go back to your website and see if the problem is fixed.

Update website’s PHP

Update website’s PHP - Fix “You are Not Allowed to Access this Page” Error

Your website’s PHP can be the cause of getting this error message. The issue can be easily resolved. Check if the PHP version is compatible with your WordPress version. If not, download the suitable version of PHP and install it. With shared hosting, you may need to reach out to your hosting provider to do so.

Check Database Prefix

Check Database Prefix

In case, if the PHP version is not the issue, you should check the database prefix. To do this, open the wp-config.php file and check the value of the prefix. The prefix is normally wp- and it should match the one used in the database. If you see any differences between the two, fix it and the Sorry, You Are Not Allowed to Access This Page error message should resolved.

Reset the website

Reset the website

In case, none of the methods provided above work yet you are still getting the annoying error message of WordPress Sorry, You Are Not Allowed to Access This Page error, the only alternative you have is to completely reset the website. Export all of your content, store it safely, and install WordPress again manually. After the installation, import your content back and see if the error is gone.

Leave a comment