How to fix the “Sorry, You Are Not Allowed to Access This Page” Error in WordPress?

Sorry, You Are Not Allowed to Access This Page

Before we dive into the solution, it’s essential to understand the root causes of this error. The “Sorry, You Are Not Allowed to Access This Page” error message is typically encountered when a user attempts to access a webpage, but the server denies their request. There can be several reasons for this denial, including:

  • Permission Issues The most common cause is a lack of proper permissions. The server might restrict access to certain pages to authorized users only.
  • Misconfigured Server – Sometimes, server configurations are not set up correctly, leading to access issues.
  • Firewall or Security Settings Firewall rules or security settings can inadvertently block access to a page, generating this error message.
  • URL Errors Typos or incorrect URLs can lead to this error as the server cannot locate the requested page.

Now that we’ve identified the potential causes, let’s move on to the solution.

Fixing the “Sorry, You Are Not Allowed to Access This Page” Error

1. Double-Check the URL

The simplest solution is often the most effective. Before diving into complex troubleshooting, ensure the URL you are trying to access is correct. Even a small typo can lead to an error message. Double-check the spelling and formatting to rule out any URL-related issues.

2. Clear Browser Cache

Clearing your browser’s cache and cookies is a simple yet effective method to resolve the “Sorry, You Are Not Allowed to Access This Page” error. Here’s a step-by-step explanation of how to do it:

  1. Open your web browser and access the settings menu.
  2. Navigate to the browsing history or privacy settings option.
Chrome History
  1. Search for a clear browsing data option and click on it.
clear browsing data
  1. Select the time range for which you want to clear the cache.
  2. Choose the cache type you want to clear, such as cookies or browsing history.
  3. Click the “Clear data” or “Clear cache” button to remove the selected data.
Clear Data

Clear your browser’s cache and cookies to fix the “Sorry, You Are Not Allowed to Access This Page” error. This often solves the issue and lets you access the page smoothly.

3. Verifying Your WordPress Role is Correct

Here’s a step-by-step guide on how to check if you have the correct WordPress role:

  1. Log in to Your WordPress Dashboard
Wordpress Dashboard
  1. Find and click “Users” in the admin menu in your WordPress dashboard.
Wordpress Users Tab
  1. Now, you can find your role within the ‘Role’ column.
Wordpress User Role

If you can’t reach the Users page, you lack administrator status. Your admin account was accidentally deleted, or your user role changed.

4. Corrupt .htaccess File

Checking for a Corrupt .htaccess File involves examining a configuration file used in web servers to ensure it hasn’t been corrupted, as it can lead to website issues. Here are the steps to check for a corrupt .htaccess file:

  1. Access your hosting control panel (cPanel) by logging in with your credentials.
Cpanel Login
  1. Navigate to the “File Manager” or similar file management tool within cPanel.
Cpanel File Manager
  1. Locate and select the root directory of your website.
Public HTML
  1. First, locate your .htaccess file. Once you’ve found it, rename it to something else, like ‘ .htaccess.old.’
Rename .htaccess file

Rename the file, then check if the issue is fixed by logging into your WordPress site. If the error remains, change the file name back to ‘.htaccess’ and move to the next step.

  1. If you can successfully log in, the next step is to create a new .htaccess file. To do this, navigate to the ‘Settings’ » ‘Permalinks’ page in your WordPress admin area.
  2. Click ‘Save Changes’ at the bottom of Permalinks settings to let WordPress create a new .htaccess file with default settings.
Save changes

Following these steps, you can address the “Sorry, You Are Not Allowed to Access This Page” error related to a potentially corrupted .htaccess file on your WordPress website.

5. Incorrect File Permissions

To check for incorrect file permissions in cPanel, ensure that your web server files and directories have the right permissions to avoid website issues. Here are the steps to follow:

  1. Log in to your cPanel account.
Cpanel Login
  1. Locate and click on the “File Manager” or a similar option in your cPanel dashboard.
File Manager
  1. In the File Manager, navigate to the directory where your website’s files are stored. This is often the “public_html” or “www” folder.
Public HTML
  1. Browse through the files and directories in your website’s folder. Right-click on a file or directory, and choose the “Change Permissions” or “Permissions” option.
Change Permissions
  1. You’ll find checkboxes or input fields to change file permissions within the Permissions window. Adjust permissions accordingly (e.g., set files to 644 and directories to 755).
  2. After adjusting the permissions, click the “Change Permissions” or “Save” button to apply the changes.
Change File Permissions

Go through the files and directories within your website’s folder and ensure they all have the appropriate permissions.

Following these steps, you can correct incorrect file permissions on your web server through cPanel, helping resolve potential issues affecting your website’s operation.

Conclusion

In summary, addressing the “Sorry, You Are Not Allowed to Access This Page” error involves various methods, including incorrect file permissions, clearing caches, and corrupt .htaccess File. By following these steps diligently and seeking assistance when necessary, you can usually resolve this issue and regain access to the desired content or services.