The “Sorry, you are not allowed to access this page” error is frustrating, especially when you are locked out of your WordPress dashboard and can’t make changes to your site. This error doesn’t cause permanent damage but prevents you from accessing important features until resolved.
In this guide, we’ll explore 9 ways to fix this common WordPress error. Let’s first understand what causes this issue before we dive into the solutions.
- What Causes the “Sorry, You Are Not Allowed to Access This Page” Error in WordPress?
- #1. Check Your WordPress Error Log
- #2. Go through Your File Permissions
- #3. Detect Changes in wp-config.php File
- #4. Disable All Plugins
- #5. Activate a Default Theme
- #6. Generate a New .htaccess File
- #7. Ensure Consistent User Role and Table Prefix
- #8. Reset Your WordPress Site
- #9. Update Your PHP
What Causes the “Sorry, You Are Not Allowed to Access This Page” Error in WordPress?
This is a relatively common WordPress error that occurs due to misconfigurations or authorization issues and prevents you from saving changes on your site. While not severe, identifying and fixing the root cause can take time.

Several factors can trigger this error:
- File permission problems: If WordPress can’t recognize you as an authorized user or administrator due to incorrect file permissions, it will block your access.
- Database inconsistencies: Mismatch of username or password in your wp-config.php file and database can trigger this error.
- Data transfer issues: When data is transferred between files and website database is inconsistent, the error appears.
- Plugin and theme conflicts: When data stored in plugins, themes or other WordPress files doesn’t match with database information, WordPress can’t execute action requests.
- Outdated PHP: Running an outdated version of PHP often causes this error.
Now that you know what might be causing the error, let’s fix it.
#1. Check Your WordPress Error Log
First, check your WordPress server’s error log to find out the specific cause. Many hosting providers allow you to access the error log through their dashboard.
If you don’t have dashboard access, you’ll need to use the credentials from your hosting control panel to access your site via an FTP client or file manager app. Go to the /wp-content/ folder and look for a debug.log file.

If the log contains recent activities you did before the error appeared, you found valuable information for troubleshooting. If not, move on to the next solution
#2. Go through Your File Permissions
As mentioned earlier, file permissions determine who can access specific files and folders in WordPress. It’s possible that WordPress isn’t recognizing your authorization to access certain areas of your site even though you’re registered as an administrator.
To check your file permissions, again, you access your server using SFTP. Once you’re logged in, click on the public_html directory, select wp-admin, wp-content, and wp-includes at once. Next, right-click on these folders and hit “File Permissions.”

A file permissions dialog box shows up. Do the following:
- Fill “755” in the Numeric Value field (755 is for all folders and sub-folders.)
- Check the “Recurse into subdirectories” option
- Select Apply to directories only

Click “OK” and your SFTP will start setting your folders and subfolders.
Next, you need to select all files in public_html, right-click on them, and select File permissions again.

This will also trigger a settings box. Similarly,
- Set the Numeric Value to 644
- Select the “Recurse into subdirectories” checkbox
- Check Apply to files only

Hit OK and you’re done. Now you should go back to your WordPress site and check if the “Sorry, you are not allowed to access this page” is gone. If not, then move on to the next method.
#3. Detect Changes in wp-config.php File
The wp-config.php file defines all the configuration settings for your WordPress site, so we need to make sure this file hasn’t been altered or compromised.
Use SFTP to access your wp-config.php file and look for any changes or modifications. This is easier if you have file integrity monitoring installed.
#4. Disable All Plugins
If you suspect a plugin or recent upgrade causes the “Sorry, you are not allowed to access this page”, we recommend you to deactivate all of your plugins then reactivate them one by one. If you turn off all plugins and the error goes away, we then know the root cause comes from one of your plugins.
Since you’re locked out of your dashboard, you have to disable plugins via FTP. The process is a little bit tricky, but don’t worry, our detailed instructions will guide you through it.
- Connect to your website using an FTP client. Once you’ve got access, go to the /wp-content/ folder and look for a sub-directory named “plugins.”
- Right-click on the folder, choose “Rename”, and enter a different name.

Now, all your plugins have been deactivated temporarily (you can change the name back to re-activate them). Go back to your WordPress site and see if the error is resolved.
#5. Activate a Default Theme
If disabling plugins doesn’t solve the problem, your theme might be the culprit, especially if you recently updated it. Try switching to a WordPress default theme like Twenty Twenty or Twenty Twenty-One.
To activate a default theme via SFTP, we can use a similar process we used for the plugins:
- Access your server
- Go to /wp-content/themes/
- Rename your active theme’s folder

When you go back to your site and log in, you should see a notification that a default theme has been activated because the current theme is broken.
If this fixes the error, rename the theme folder back to its original name and then investigate each theme to find the problematic one.
Note: Deactivating a theme can affect your site’s appearance and functionality. You may need to consult with developers for help.
#6. Generate a New .htaccess File
Another way to troubleshoot the “Sorry, you are not allowed to access this page” issue is by creating a new .htaccess file. Connect back to your site with SFTP and head to your public_html folder to search for your .htaccess file.
Once you’ve found it, right-click and rename your existing .htaccess file, for example, .htaccess-backup. Next, right-click it and select Download. Next, open the file in a text editor and insert the following code snippet into it:
#BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCOnd %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
#END WordPress
Now rename the file back to .htaccess, save your changes, and upload it to your server. If it was this file causing the “Sorry, you are not allowed to access this page” error, then it should now be fixed.
#7. Ensure Consistent User Role and Table Prefix
Technically, the database contains almost everything on your WordPress site, and user roles are no exception. If the user role prefix in the database is different from an administrator role, you lose access to certain parts of your site.
To check for discrepancies, you need to visit your wp-config.php file.
Use SFTP and phpMyAdmin to access your database. Ho to the wp-config.php file and look for the $table_prefix. Note down its value.

Select the wp_users table, find your username and ID, and note them down. Head over to the wp_usermeta table and check the wp_capabilities row. Your user role is in the meta_value field.

If the row displays any words different from the administrator, click Edit and change the wording. Keep in mind that you stay away from any of the surrounding text. Finally, return to your WordPress and check whether the error has gone.
#8. Reset Your WordPress Site
In the worst case scenario, the error comes from an installation issue. To deal with it, you may need to reset your WordPress site. Before doing this, you have to back up your WordPress site to ensure you don’t lose any important data and content. long-term.
Some WordPress plugins you can use to make this easier are WP Reset or Advanced WordPress Reset.You can also contact your WordPress host for any further help. Note: we only recommend this method for new WordPress sites, which haven’t received much data.
#9. Update Your PHP
As we mentioned before, an outdated PHP is one of the primary causes of the “Sorry, You Are Not Allowed to Access This Page” error. As well as this, running an old version of PHP can expose your site to security risks, including getting hacked. As such, not only updating the PHP version does bring back your site to normal, but it also tightens your site security.
Before starting the upgrade process, backing up your site is a must. Plus, you need to make sure your site is compatible with the latest version of PHP. It’s advisable to test it on your WordPress staging site.
Once done, you can run the update. There are 2 options for you to choose from. If you’re using VPS, you can upgrade your PHP using the command line. Either way, if you don’t have access, you should change the PHP version in the control panel.
If you’re with another provider, you may be able to follow a similar process via your own control panel. After logging in to your control panel, in your cPanel dashboard, go to the Software section > Select PHP Version.
Next, click on the current PHP version. A dropdown shows up containing all PHP versions available on your hosting server. Select a recent version then Set as Current to save the changes.

If nothing from the above advice has worked for you, it’s recommended that you contact your web host for further support.
Bring Your WordPress Site Back to Normal!
We’ve explored several potential causes of the “Sorry, you are not allowed to access this page” WordPress error, and provided nine effective solutions.
Remember to:
- Check WordPress error logs to identify specific causes
- Verify file permissions
- Examine the wp-config.php file for changes
- Disable plugins and themes
- Generate a new .htaccess file
- Ensure consistent user roles and table prefixes
- Update your PHP version
- Reset your WordPress site as a last resort
Always back up your site before making significant changes to preserve your important data. If you have questions about resolving this WordPress error, feel free to leave a comment below.