Are you seeing the “Sorry, you are not allowed to access this page” error in WordPress?
This error usually displays when you are trying to see a page in your WordPress dashboard that your user role doesn’t have permission to access. However, you might also see the error even when you are supposed to have access to that page.
In this article, we will 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 example, 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 the “Sorry, you are not allowed to access this page” notification even when you should have access to view the page.
If you are not the site owner or administrator, and you are seeing this error, then you should contact the site owner or admin to let them know. They can explain why you don’t have access to the page, or they can change your role to grant you access.
If you are the site owner or have an admin role, but you still see the “Sorry, you are not allowed to access this page” error when trying to log in to your own WordPress website, something has gone wrong with the permissions settings.
There are several potential causes of the error, like an issue with a WordPress core update. Perhaps there was a problem when a theme or plugin was updated. Or maybe something has gone wrong with your configuration.
If you are seeing this error when you try to log in, then you won’t be able to fix the error by changing your WordPress settings in the admin dashboard. You will have to work with the website’s files and databases directly.
This can be tricky 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, here are some solutions you can follow to troubleshoot and fix the “Sorry, you are not allowed to access this page” error in WordPress:
- Option 1: Check You Have the Correct WordPress Role
- Option 2: Check for a Corrupt .htaccess File
- Option 3: Check for Incorrect File Permissions
- Option 4: Activate the Default Theme Using FTP
- Option 5: Deactivate All Plugins
- Option 6: Check Your WordPress Error Logs
- Option 7: Update to the Latest PHP Version
- Option 8: Restore Your Most Recent Backup
- Option 9: Check and Change Your Database Prefix
- Option 10: Contact Your Hosting Provider
Video Tutorial
If you’d prefer written instructions, then just keep reading.
Option 1: Check You Have the Correct WordPress Role
If you are able to log in to the WordPress admin dashboard but can’t access specific pages, then your WordPress user role might have been changed, and you are no longer an admin.
From the WordPress dashboard, you can see your user role by visiting the Users » All Users page and looking at 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.
Option 2: Check for a Corrupt .htaccess File
If you have an admin user role, and you are still seeing “Sorry, you are not allowed to access this page” on the front end, then the cause of the error could be a corrupt .htaccess file. We can check this by renaming the file.
You will need to use an FTP client like FileZilla or the file manager feature in your WordPress hosting account. If you haven’t used FTP before, then you may want to see our guide on how to use FTP to upload files to WordPress.
Using your FTP client, you need to navigate to the root folder (most likely the public_html folder) containing all your WordPress files. Once you find the .htaccess file, you need to rename it to something else, such as ‘.htaccess.old’.
If you cannot find your .htaccess file, then see our guide on how to find .htaccess in WordPress.
Once you have renamed the file, try logging in to your WordPress site to see if that has fixed the problem. If it hasn’t, then rename it back to .htaccess and move on to the next step.
If you can log in, then you have 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.
Option 3: Check for Incorrect File Permissions
While you have your FTP client open, we will check to make sure 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 select ‘File permissions…’
This will bring up the file permissions dialog box.
Now, you need to enter 755 in the numeric value field. After that, you can click on the ‘Recurse into subdirectories’ checkbox and then select the ‘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.
Next, 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 the ‘Recurse into subdirectories’ checkbox and then select ‘Apply to files only’.
Click on ‘OK’ to continue, and your FTP client will now start setting file permission for all files on your WordPress site.
Once you have done this, try logging in to your WordPress website again. If you are successful, then you’ve fixed the problem. If not, then move on to the next step.
Option 4: Activate the Default Theme Using FTP
The next solution requires checking if your active WordPress theme could be causing this issue.
You’ll need to connect to your website using an FTP client or your web hosting provider’s file manager. Then, navigate to the wp-content folder.
Once there, 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 will call it ‘themes.deactivate’.
This will activate the default theme. Now, try to log in to 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 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 active 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.
However, if the error returns, then report it to the theme author. They may be able to help you solve the problem or fix a bug in the theme.
Option 5: Deactivate All Plugins
The next solution is to check whether a faulty WordPress plugin is causing the error. We will do that by temporarily deactivating all plugins.
If you are not sure how to do that without accessing the WordPress admin area, don’t worry. You can read our guide on how to deactivate plugins without access to the WordPress dashboard.
Option 6: Check Your WordPress Error Logs
You may be able to check an error log for clues about what went wrong. Your web hosting provider might be keeping logs, or you may have previously set WordPress up to keep them.
For more details, check our guide on how to set up WordPress error logs or contact your hosting provider.
Option 7: Update to the Latest PHP Version
If your WordPress site is running an outdated version of PHP, then it may be causing problems. Upgrading to the latest version may be helpful.
For more information, check our guide on how to update your PHP version in WordPress or contact your hosting provider.
Option 8: Restore Your Most Recent Backup
If you have 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 problem is that you will lose any changes to your settings and content made after the backup.
For more information, check our beginner’s guide on how to restore WordPress from backup.
Option 9: Check and Change Your Database Prefix
If you previously decided to change your database table prefix in the wp-config.php file, then there’s a chance that there is a discrepancy between your database prefix and your WordPress database. This can cause the “Sorry, you are not allowed to access this page” error.
The solution to this is to check your database via phpMyAdmin and see if the database table names have the prefix value set in your wp-config.php file.
To do this, you can check out our guide on how to change the WordPress database prefix.
Option 10: Contact Your Hosting Provider
If you are unable to fix the error on your own, then you should contact your WordPress hosting company to see if there is anything that they can do.
Many providers offer excellent technical support and may be able to solve the problem for you.
For example, 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.
For the best results, make sure to check our guide on how to properly ask for WordPress support and get it.
We hope this tutorial helped you learn how to fix the “Sorry, you are not allowed to access this page” error in WordPress. You may also want to bookmark our ultimate guide on how to fix the 403 forbidden error or how to secure your WordPress website.
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
Kzain
I sometimes get this error i wanted to ask about the PHP Version my hosting provides PHP Version
8.2 version but by default it’s set to a different version 8.0 so I changed the PHP version to the latest because after the new WordPress version
Mark K
Also found an issue with a plugin that had a setting page that caused this “error” when the constant DISALLOW_FILE_MODS was true e.g. define( ‘DISALLOW_FILE_MODS’, true );
WPBeginner Support
Thank you for sharing another possible reason for this error
Admin
Rob Mahan
My website had been hacked, probably due to a weak login password. After I cleaned out all the bad posts, the site seemed functional, but I was experiencing the “Sorry, You Are Not Allowed to Access This Page” error when I tried to updated the WordPress version. Also, I could not delete unused themes or plugins. I tried everything in this article, all to no avail.
I finally found these two lines which apparently had been added to my wp-config.php file. Once I deleted them, full administrative functionality was restored.
define(‘DISALLOW_FILE_EDIT’,true);
define(‘DISALLOW_FILE_MODS’,true);
WPBeginner Support
Thank you for sharing this in case other users run into the same issue!
Admin
Kimberly
That worked! Thanks.