How To Resolve "Sorry, You Are Not Allowed To Access This Page" Error In WordPress

Nkenganyi Clovis WordPress Tutorials Mar 31, 2024

Sometimes when you are trying to access a page in your own WordPress dashboard, you get a frustrating response like “Sorry, you are not allowed to access this page”.

At times the error is shown because you are not allowed to access that page based on the user role you have on that website while at times even when you are supposed to access the page, you receive the same error.

There can be several reasons to trigger this error and in this tutorial, we will understand how to troubleshoot the "Sorry, You Are Not Allowed To Access This Page" error in WordPress.

What Causes The "Sorry, You Are Not Allowed To Access This Page" Error In WordPress?

There are many reasons you can experience the 'Sorry you are not allowed to access this page on your WordPress website', which we are going to discuss here.

Create Amazing Websites

With the best free page builder Elementor

Start Now

1. User Role

In WordPress, what one can access is defined based on the role they have in the website. For example, if you are an author, you might not have access to the administration settings as you can only have access to write and edit your posts.

This is why whenever you try to edit someone else's post or head over to the administration settings, you will get the "Sorry, you are not allowed to access this page” error on your WordPress.

2. File Permission

File permissions determine who can read, write, and execute files on your server. If they are set incorrectly, WordPress may not be able to access some files and folders. You can correct this by changing the file permissions using FTP.

3. Corrupt .htaccess File

The .htaccess file controls how your server handles requests to your site. If it is corrupted, it may cause errors and prevent you from accessing your dashboard. You can fix this by renaming or deleting the .htaccess file using FTP.

4. Outdated Theme or Plugin

Sometimes, a theme or plugin update may cause compatibility issues or conflicts with WordPress or other plugins. This may result in errors and lock you out of your site. You can resolve this by deactivating all your plugins using FTP and switching to the default theme

5. Outdated PHP Version

WordPress requires a minimum PHP version to run properly. If your server is running an outdated version of PHP, it may cause errors and prevent you from logging in. You can update your PHP version from your hosting account or contact your hosting provider for assistance.

How to Fix 'Sorry you are not allowed to access this page'

We are going to look at several ways in which we can fix this error on our WordPress website.

1. Check If Your WordPress Role Is Correct

There might be a problem with your user roles in WordPress if you can log in but are unable to access a particular page. You might want to contact the website owner and get your user role changes. Here's how you can change the user role in WordPress.

From the WordPress dashboard, head over to the users and then All users.

Under the role column, you will see your WordPress user role. If you can not access the user's page, that means that you are not an administrator.

It is also possible that somebody has changed your user role or deleted your administrator account. In such a case you will have to add a new user via phpMyAdmin to the WordPress database.

2. Check If There Is A Corrupt .htaccess File

If you have your administrator role and you are still unable to access the administration settings of your WordPress website, you may have a corrupt .htaccess file in your database.

Using an FTP client you will have to rename the .htaccess file from your database. First, you need to find the .htaccess file in the root folder that has all your WordPress files and then rename it.

After you have successfully renamed the file, try logging in to your WordPress again and see if the problem is solved. If there is still a problem, rename the file back to .htaccess and follow this tutorial further.

Next, you will have to generate a new .htaccess file by going to the Settings in your WordPress dashboard and then Permalinks.

On the Permalinks page, just click on the Save Changes button at the bottom and WordPress will create a new .htaccess file.

3. Check If There Are Wrong File Permissions

After generating a new .htaccess file, while you are navigating through the root folder of WordPress, make sure to check if there are any incorrect permissions. File permissions define which files can be accessed.

644 means all files
755 means all folders and sub-folders

These are the recommended settings and will work for most of the users. In the root folder, select the wp-admin, wp-content, and wp-includes, and then right-click to select File Permissions.

You will see the permissions dialogue box where you need to add 755 in the numeric value field. Next, you need to check the Recurse into subdirectories and then enable the Apply to directories option at the bottom.

Press OK when you are done and all the settings will be applied. It might take some time so you will have to wait.

For the next step, you need to select all the files and folders in your WordPress root folder and then right-click to select File Permissions.

Just like before, the permission dialogue box will appear.

But here in the Numeric Value field add 644. Then tick the Recurse into the subdirectories box and then enable Apply to files only and then press OK.

It will take some time till the FTP client settles the file permissions and then once again, try logging in to your WordPress. If the problem is still not solved, let's move to the next step.

4. Deactivate All Plugins Using FTP

If the steps above have not resolved the problem, we will check if the plugins are causing the issue by temporarily deactivating all the plugins at once using the FTP.

Once you have connected your WordPress website with FTP, go to the wp-content folder from your WordPress root folder.

There you will see the file carrying all the plugins. Just rename this file to something else such as plugins. deactivated in this case.

This will deactivate all the plugins at once. Now you can go back and retry to log in to your WordPress. If it works, you will have to check which plugin is causing the problem.

To check the plugins individually, rename the plugins.deactivated folder back to plugins.

Next, enter the folder and rename the first plugin to something like plugin-name.deactivate and the plugin will be deactivated. Then, go back to try and log in to your WordPress. Repeat the process for all the plugins to find out which plugin is causing the problem.

While deactivating all the plugins did not resolve the issue. We still have some other methods to try and get out of this.

5. Activate The Default WordPress Theme Using FTP

If the plugins are right, we will have to check out if there is a problem with your WordPress theme. Similarly, you will have to connect your FTP client with your WordPress and then go to the wp-content folder from the root folder.

In the folder, rename the themes folder to themes.deactivate and this will deactivate your current WordPress theme and enable the default WordPress theme.

If you can log in to your WordPress it means that there is some issue with your WordPress theme. You can either switch to a different theme or reinstall the same theme and configure it correctly. If the issue stands, you can contact the theme creators to resolve the bugs.

6. Change PHP Version

If your WordPress site is running on a PHP version that is not compatible with your WordPress version, then you are more likely to encounter this error.

We will check out a few easy steps on how to access and change our PHP version using the cPanel.

First, you will have to log in to your cPanel and go to the Software options. Once you have found it, click on Select PHP Version.

When you click on that, you will gain access to the actual page where you will select the PHP version you want.

Note: Most times, it is advisable to choose the latest version since it is less vulnerable to security issues.

Conclusion

I know how frustrating it can be when you encounter the “Sorry, You Are Not Allowed to Access This Page” error in WordPress. You may feel like you’ve lost control of your site, or that you’ve done something wrong. But don’t worry, you’re not alone. This error is quite common and can be fixed with some simple steps.

You’ve already learned the possible causes and solutions for this error in this post. You’ve also learned how to use FTP to troubleshoot and restore your site. You’ve gained valuable skills and knowledge that will help you prevent and resolve future issues.

Now, all you need to do is apply what you’ve learned. The first thing you should do is back up your site, just in case something goes wrong. Then, follow the steps outlined in this post to fix the error and regain access to your dashboard. If you need more help, you can always contact your hosting provider or WordPress support.

You’ve got this! You’re a WordPress pro who can handle any challenge. You’re not afraid of errors, because you know how to fix them. You’re confident and proud of your site, and you’re ready to share it with the world.

Congratulations on making it to the end of this post. You’ve just taken a big step towards improving your WordPress skills and your site’s performance. I hope you found this post helpful and informative.

Thank you for reading, and happy WordPressing!

Divi WordPress Theme