Are you annoyed with the “Sorry, you are not allowed to access this page” error in WordPress?
This error usually appears when you’re trying to see a page in your WordPress dashboard that your user role doesn’t have permission to see.
However, you might see the error sometimes even when you’re supposed to have access to that page. This error can be caused by a lot of different reasons which makes it difficult for beginners to troubleshoot.
In this tutorial, we’ll show you how to fix 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?
WordPress user roles and permissions define what your users can and can’t do in WordPress. For instance, an author on your site wouldn’t be able to edit the post of another author, only their own posts.
If someone gave an author the link to edit someone else’s post, then they would see the “Sorry, you are not allowed to access this page” WordPress error when following the link.
However, sometimes you might see “Sorry, you are not allowed to access this page” when you have access to view the page.
If you’re not the site owner or administrator, and you’re seeing this error, then you should contact the site owner or admin to notify them. They can explain why you don’t have access to the page, or they can change your role to give you access.
If you are the site owner or have an admin role, but you’re still seeing the “Sorry, you are not allowed to access this page” error when trying to log in to your own website, then something has gone wrong with the permissions.
Maybe there was an problem with a WordPress update. Maybe there was a issue when a theme or plugin was updated. Or maybe something has gone wrong with your configuration.
If you’re seeing this error when you try to log in, then you cannot fix the error by changing your WordPress settings in the dashboard. You’ll have to work with the files and databases directly.
This can be hard for beginners and making a mistake could make things worse. As a precaution, we recommend you first make a complete backup of your WordPress website.
You could also start by contacting your hosting provider. They may be able to fix the problem for you.
That being said, below are some steps you can follow to troubleshoot and fix the “Sorry, you are not allowed to access this page” error in WordPress.
Checking You Have the Correct WordPress Role
If you’re able to log in to the WordPress dashboard, but cannot access specific pages, then the problem could be that your WordPress user role was changed, and you’re no longer an admin.
From the WordPress dashboard, you can see your user role by visiting the Users » All Users page, and looking under the ‘Role’ column.
If you don’t have access to the Users page, then this means that you are not an administrator.
If you or someone else accidentally deleted your administrator account or changed your user role, then you can add a new admin user with phpMyAdmin.
Checking for a Corrupt .htaccess File
If you have an admin user role, and you’re still seeing the “Sorry, you are not allowed to access this page” error, then it might be caused by a corrupt .htaccess file. We can check this by renaming the file.
You will need to use an FTP client or the file manager feature in your WordPress hosting account.
Using your FTP client, you need to navigate to the root folder containing all your WordPress files. Once you find the .htaccess file you need to rename it to something else, such as .htaccess.old.
Once you rename the file, try logging onto your WordPress site to see if that has fixed the problem. If it hasn’t, then you should rename it back to .htaccess and move on to the next step.
If you can log in, then you fixed the problem. The next step is to generate a new .htaccess file. To do that, navigate to the Settings » Permalinks page in WordPress.
Simply click on the Save Changes button at the bottom of the page and WordPress will generate a fresh .htaccess file.
Checking for Incorrect File Permissions
While you have your FTP client open, we’ll check to ensure there isn’t a problem with your file permissions. File permissions control who can access files and folders on your website.
The following settings are recommended for most users:
755 for all folders and sub-folders.
644 for all files.
Using your FTP client, you need to navigate to the root folder containing all your WordPress files and select the wp-admin, wp-content and wp-includes folders. Then you need to right click and choose ‘File Permissions’.
This will bring up the file permissions dialog box.
Now you need to enter 755 in the numeric value field. Then, you can click on the ‘Recurse into subdirectories’ checkbox and then select ‘Apply to directories only’ option.
Click on the OK button to continue. Your FTP client will start setting file permissions to folders and sub-folders. You will need to wait for it to finish.
Then, you need to select all files and folders in the root folder of your WordPress site and then right click to select file permissions.
The file permissions dialog box would appear.
This time you need to enter 644 in numeric value. After that you need to click on ‘Recurse into subdirectories’ checkbox and then click ‘Apply to files only’ option.
Click on OK to continue and your FTP client will now start setting file permission to all files on your WordPress site.
Once you’ve done this, try logging into your WordPress website again. If you’re successful, then you’ve fixed the problem. If not, then move on to the next step.
Deactivating All Plugins Using FTP
If the steps above haven’t solved the issue, then our next step is to check whether a faulty WordPress plugin is causing the error. We’ll do that by temporarily deactivating all plugins.
First, you need to connect to your website using an FTP client. Once connected, you need to navigate to the /wp-content/ folder.
Now, you will see a folder called plugins. This is where WordPress stores all plugins installed on your website.
You need to right click on the plugins folder and select Rename. After that, you should type in a different name. We will call it ‘plugins.deactivate’.
All of your plugins have been deactivated. Now try to log into your WordPress site to see if this has fixed the problem.
If you still receive the “Sorry, you are not allowed to access this page” error, then the issue isn’t caused by a plugin. You will need to rename the ‘plugins.deactivate’ folder back to ‘plugins’ and move on to the next step.
If you can now log in, then you know that one of the plugins is causing the error. We just have to find out which one.
Using your FTP client, rename the ‘plugins.deactivate’ folder back to ‘plugins’ then navigate inside the plugins folder. Now you rename the first plugin to something like ‘plugin-name.deactivate’.
Now go back to your site to see if you can log in. If you can’t, then change the plugin’s name back and move on to the second plugin. Repeat the process until you find the one that created the issue.
Once you’ve found the faulty one, you can switch to a different plugin that doesn’t cause the problem. Or you can contact the plugin author and work with them to find a solution.
Activating the Default Theme Using FTP
If the plugin solution didn’t work for you, then we’ll need to check if your WordPress theme could be causing this issue.
This step is similar to deactivating your plugins. You’ll need to connect to your website using an FTP client and navigate to the wp-content folder.
Here, you will see a folder called themes. This is where WordPress stores all themes installed on your website.
This time you need to right-click on the plugins folder and select Rename. We’ll call it ‘themes.deactivate’.
This will activate the default theme. Now try to log into your WordPress site to see if this has fixed the problem.
If you still see the “Sorry, you are not allowed to access this page” error, then the problem isn’t caused by a theme. You need to rename the ‘themes.deactivate’ folder back to ‘themes’ and move on to the next step.
If you can log in, then the previous theme caused the problem and you can start to troubleshoot. You could try using a different theme or reinstall the same theme and carefully configure it.
If the error comes back, then report it to the theme author. They may be able to help you solve the problem or fix a bug in the theme.
Final Troubleshooting Steps
If you’re still reading, then unfortunately the other steps haven’t resolved your problem. Here are some things you can try.
Check Error Log
You may be able to check an error log for clues about what went wrong. Your hosting provider may be keeping logs, or you should have previously set WordPress up to keep them.
Update to Latest PHP
If your WordPress site is running an older version of PHP, then it may be causing problems. Upgrading to the latest version may work.
Restore Your Most Recent Backup
If you’ve made a recent backup of your WordPress website, then restoring it to an earlier version is likely to fix the “Sorry, you are not allowed to access this page” error.
The issue is, you will lose any changes to your settings and content made after the backup.
Contact Your Hosting Provider
If you can’t fix the error on your own, then you should contact your WordPress hosting company to see if there is anything they can do.
Many providers provide excellent technical support and may be able to solve the problem for you.
For instance, they may be able to check their server error logs or have created their own backups of your WordPress site. They will be able to advise you on how they can help and what you should do next.
We hope this tutorial has helped you learn how to fix the “Sorry, you are not allowed to access this page” error in WordPress.