Fix the “Sorry, You Are Not Allowed to Access This Page” Error in WordPress
Being locked out of your own WordPress admin panel is one of the most terrifying experiences you can have. If you’ve ever tried to log in and received the notice “Sorry, you are not allowed to access this page,” you know how frustrating it can be.
Fortunately, you have various options for troubleshooting this problem. With a little patience, you’ll be able to correct the error and resume managing your WordPress site in no time.
In this article, we’ll look at the “Sorry, you are not permitted to view this page” problem and the reasons for it. Then we’ll walk you through the various options to help you select the one that best fits your needs.
Let’s get started!
Contents Table of Contents
Understanding the “Sorry, You Are Not Allowed to Access This Page” Error
How to Fix the WordPress Error “Sorry, You Are Not Allowed to Access This Page” (11 Potential Solutions)
The “Sorry, You Are Not Allowed to Access This Page” Error and How to Fix It
The “Sorry, you are not permitted to access this page” message in WordPress is designed to be a helpful security measure, despite the fact that we’re referring to it as a “error” for the sake of this piece.
Finally, viewing this notification indicates that you are being blocked from a specific region due to a permissions setting.
This becomes a problem if you’re shut out of a component of your site that you should have access to, which may be anyplace on the backend as an Administrator. When this happens, it’s usually as a result of a recent theme, plugin, or WordPress core upgrade.
For a variety of reasons, you may receive the notice “Sorry, you are not permitted to view this page.” It’s possible that WordPress isn’t recognizing you as a site administrator. In some cases, the information in your site’s core code, a theme, or a plugin may differ from what’s in your database.
Incorrect information in your wp-config.php file or a site running an outdated version of PHP are two other possibilities. This issue may prevent you from accessing the full admin section or only a piece of it, depending on the source.
You’ll need to use File Transfer Protocol (FTP) or phpMyAdmin to remedy this issue because you won’t be able to access key settings via the dashboard. Before you begin troubleshooting, make a backup of your site and brush up on how to use these platforms.
For all plans, Info Kinsta provides automated daily and system-generated backups. Hourly backups are also provided as an option.
The most aggravating aspect of receiving the “Sorry, you are not allowed to view this page” message is determining which of the many causes is at play. Fortunately, there are a variety of remedies you can try to figure out what’s causing the issue.
How to Fix the “Sorry, You Are Not Allowed to Access This Page” Error in WordPress (11 Potential Solutions)
The “Sorry, you are not allowed to visit this website” error requires a lot of effort to fix because there are so many possible causes. This vast list of options may seem daunting, but it covers a wide range of scenarios to help you find the best fit for your website.
1. Go back to a previous version of your website and restore it.
Restoring your site to an earlier version is the easiest and often fastest way to get back into your WordPress dashboard. The mistake you’re seeing could be the result of a recent change, such as an update. You should be able to access your site again after undoing your most recent change.
In this aspect, Kinsta users have it simple. With a single click, you may restore a WordPress backup in your hosting account:
Using MyKinsta to restore a backup
The disadvantage of this technique is that you may lose your recent adjustments and will have to figure out how to achieve your objectives without making the same mistake.
As a result, you may prefer to restore your backup to a staging site. You can then experiment with other tweaks to figure out what’s causing the issue. After you’ve figured out what’s causing the problem, you can undo the inconvenient adjustment and regain access to your website.
2. Turn off all your plugins
A recent addition or upgrading of a plugin could be the cause of the “Sorry, you are not allowed to view this page” message on your site. If you feel this is the case, the best course of action is to disable each of your plugins individually.
If you disable a plugin and the notice disappears, you’ve discovered the source of the problem. You can then use that plugin to troubleshoot the problem (or do without it if it’s not critical to your site’s functionality).
Of course, if you’re completely shut out of your dashboard, this procedure becomes a little more difficult. You’ll need to use an SFTP client like FileZilla to connect to your site. Once you’ve done that, go to wp-content and look for the plugins subdirectory:
By changing the folder, you can disable all plugins.
Rename your most recently-added plugin to something like “plugin-name old” after entering this subdirectory. Return to your site to see if the problem has been resolved. If not, rename the plugin and go through the process again with the next one.
3. Select a default theme to use.
Another reason for this problem could be that you recently updated or installed a theme. Activating a default WordPress theme, such as Twenty Twenty or Twenty Nineteen, is your best bet for correcting this problem.
You’ll have to utilize FTP again if you don’t have access to your admin area. Using FileZilla, connect to your server and then go to wp-content > themes:
Rename the folder to disable the current theme.
The rest of the procedure is very similar to the one for disabling your plugins mentioned above.
Return to your site and log in after renaming the folder for your active theme. A message should appear informing you that the active theme is broken and that the default theme has been reinstated.
The theme can then be troubleshooted. Your site should at the very least be accessible, even if it is using the incorrect theme.
4. Double-check that you’re an administrator.
Another possibility is that your user role was altered by accident and you are no longer identified as an Administrator. This is a regular issue with multisite deployments. To find out if this is the case, log into phpMyAdmin and look for the wp users table:
Table of WP users
In phpMyAdmin, the wp user’s table
Make a note of your login and ID. Then look for the wp capabilities row in the wp usermeta table:
phpMyAdmin’s wp usermeta table
If you have Administrator rights, this row’s meta value will be:
a:1:{s:13:”administrator”;s:1:”1″;}
If your wp user meta table says something else, you can update it by clicking the Edit link. Alternatively, you can use phpMyAdmin to establish a whole new Administrator account. Return to the wp users table and select the Insert tab at the top of the table to take this route:
Change the wp user’s table’s user information.
Then, using your new user details, fill up the forms. When you’re finished, click the Go button to see your new user appear in the table. Return to the wp user meta table and write down the ID for this account.
Fill in the following information in the fields that appear after clicking Insert:
Unmeta id: This field will be filled in for you automatically if you leave it blank.
Use the ID from the WP Users table as the user id.
Set this value to “wp capabilities” in the meta key.
Meta value: Include the above-mentioned line.
You should now be able to log in to your WordPress admin area using your new credentials. Delete your previous account or, via the dashboard, modify its user role to Administrator and delete the new one instead.
Do you want to discover how we grew our traffic by over 1000%?
Join the 20,000+ people who receive our weekly email with WordPress insider secrets!
5. Examine Your Error Log to Determine the Root Cause
Checking your server’s error log is a smart technique to streamline debugging any problem on your site. The “Sorry, you are not permitted to access this page” warning could be caused by plugin or theme compatibility difficulties, database errors, or problems with your site’s files.
Depending on your hosting provider, you’ll see your server’s error log in a different way. This step is as simple as logging into your MyKinsta dashboard for Kinsta clients. There, find the site that’s having issues and navigate to Logs:
Logs tab in MyKinsta
From the drop-down box, select error.log. If you find one of the causes of the warning in your log, you can take steps to resolve it. You’ll have to try another option from this list if it doesn’t work.
6. Double-check that the database prefix is correct.
There is a prefix for every MySQL database. You may receive the warning “Sorry, you are not permitted to access this page” if the one specified in your website’s files does not match the one shown in phpMyAdmin.
This can happen when migrating your site, especially if you’ve been developing on a local staging server and are now moving to a live server. You’ll need to visit your wp-config.php file to look for errors.
As we’ve mentioned in past solutions, you can achieve this using SFTP. When you’re in the wp-config.php file, check for the prefix for your database (the default is “wp_”):
Prefix for the database
Then, in phpMyAdmin, look at the prefixes for the tables in your database. They should be the same as the ones stated in your wp-config.php file, as seen below:
The prefixes in your wp-config.php file should match.
If they don’t match the prefix in your wp-config.php file, you’ll need to make the necessary changes.
7. Examine your wp-config.php file for any changes.
On a related point, you should check your WordPress configuration file for any modifications. This is especially true if you were updating this file just before receiving the “Sorry, you are not permitted to access this page” warning or if you believe your WordPress site has been hacked.
You can use SFTP to view your wp-config.php file and look for anything unusual. However, if you have some kind of file integrity monitoring or change detection tool in place, this process will be lot easier.
8. Install the most recent PHP version.
This could be the cause of your problems if your WordPress site is using an old version of PHP. Even if upgrading PHP doesn’t fix the problem, it should enhance the overall security and performance of your site.
Are you fed up with WordPress difficulties and a sluggish host? We offer world-class support from WordPress specialists who are available 24 hours a day, seven days a week, as well as lightning-fast servers. Take a look at our plans.
Create a backup of your site before you begin the upgrade process. Even if you’re shut out of your admin area, you can do this manually or through your MyKinsta dashboard. After you’ve saved your backup, check to see if your account is compatible with the most recent PHP version. A WordPress staging site is one way to do this.
If all goes smoothly, you can proceed with the upgrade. Customers of Kinsta can easily do so by entering into their MyKinsta dashboard and going to the appropriate website. After that, go to Tools > PHP Engine > Modify and choose the most recent version from the drop-down menu:
How can I upgrade MyKinsta’s PHP version?
If you’re with a different provider, you might be able to do the same thing through your own control panel. If you need additional information, you should contact your site host.
9. Examine the Permissions on Your Files
It’s also conceivable that the file permissions on your site have been changed. Even though you’re still identified as an Administrator, WordPress may consider you unauthorized to visit specific portions of your site in this instance.
You’ll need to utilize SFTP to access your server to check the file permissions on your site. Enter the public html directory after logging in and bulk-select wp-admin, wp-content, and wp-includes. Choose File Permissions: from the context menu when you right-click on these folders.
Examining the file permissions
Make sure the following settings are selected in the resultant window:
755 has been set as the Numeric Value.
The option to recurse into subdirectories is enabled.
Only apply to directories is chosen.
When you’re finished, click OK. Then, with all the other files in public html highlighted, right-click on them and select File Permissions once more:
Making changes to file permissions
Set the following choices in the permissions window this time:
644 should be the numeric value.
Checking recurse into subdirectories is still recommended.
Only apply to files should be chosen.
Then, go back to your site to see if the “Sorry, you are not permitted to visit this page” warning has disappeared.
Create a new.htaccess file in step 10.
If none of the preceding methods work, you may need to rename your.htaccess file. To do this, open FTP and go to the public html folder. If you don’t see your.htaccess file there, follow the FileZilla instructions for exposing hidden files.
Then, similar to how we renamed plugin and theme files in previous solutions, you’ll need to rename your existing.htaccess file. It’s best to use a familiar name like.htaccess original or.htaccess backup.
Then pick Download from the context menu by right-clicking on the file. Replace the contents of the file in a text editor with the following:
#WORDPRESS BEGINNING
RewriteEngine is enabled.
/ / / / / / / / /
index.php RewriteRule
– [L] $
percent REQUEST FILENAME rewriteCond
-f
REQUEST FILENAME! RewriteCOnd percent
-d
/index.php RewriteRule [L]
#END WordPress
This file should be renamed.htaccess and uploaded to your server. This file should now be corrected if it was the source of the “Sorry, you are not allowed to view this page” issue.
11. Clear the cache on your WordPress site
In the worst-case situation, there could be a problem with the installation. You’ll need to reset your WordPress site to solve it. Because resetting your site will result in the loss of all posts, pages, and user comments, it’s critical that you have a recent backup that you can restore after this process is complete.
There are various ways to accomplish this, including utilizing your MyKinsta dashboard, a WordPress plugin, or WP-CLI (the WordPress command line). This should only be used as a last option to avoid losing your website’s content.
Is the notice *Sorry, You Are Not Allowed to Access This Page* giving you the creeps? To regain access, try one of these techniques. 🙅♂️🔑
TO TWEET, CLICK HERE
Summary
To say the least, being locked out of your WordPress admin dashboard is nerve-wracking. Finding the appropriate solution to the “Sorry, you are not permitted to view this page” mistake as quickly as possible is critical for your site’s success as well as your own peace of mind.
We explored a wide range of possible reasons and solutions for this problem in this post. Let’s take a brief look at them:
Restore your site to a prior state.
Disable all plugins on your computer.
Activate a pre-installed theme.
Ascertain that you are an administrator.
To find out what’s causing the problem, look through your error log.
Check to see if your database prefix is correct.
Check your wp-config.php file for any modifications.
Upgrade to the most recent PHP version.
Examine the permissions on your files.
Make a new.htaccess file for your website.
Your WordPress site should be reset.
Good luck with your repairs!