It can be frustrating to be locked out of your own WordPress admin dashboard. And this is what happens when the “Sorry, you are not allowed to access this page” error occurs. In addition to preventing you from making crucial changes to your website, it can undo all the hard work that you’ve put in.
Fortunately, there are several solutions available to troubleshoot this error. With little patience, you can get this sorted and get back to managing your
WordPress website.
In this article, we will walk you through various tried and tested methods to fix this error. But before that, let’s see what causes this error.
Cause(s) of “Sorry, You Are Not Allowed to Access This Page” Error
WordPress user roles and permissions indicate what the website users can and cannot do in WordPress. For example, an author on your website cannot edit another author’s post.
You encounter the “Sorry, You Are Not Allowed to Access This Page” Error when there is a permission setting that is blocking you from entering a certain area. While this is a great security measure, it becomes a problem when you are locked out of a part of the website to which you should have permission as an administrator.
While you often face this error after an update to a plugin, theme, or WordPress core, there could be other possible reasons:
- WordPress does not recognize you as an administrator
- The information contained in your website’s core code, plugin or theme may not match that in your database.
- Incorrect information in your wp-config.php file
- Your website is running an outdated version of PHP
(Irrespective of the source, this error won’t allow you to access a portion of or the entire website)
Since it is likely that you’ll not be able to access the key settings via the dashboard (as you are blocked out), you will need to use phpMyAdmin or File Transfer Protocol (
FTP) to resolve the issue. Ensure that you back up your website before you begin the troubleshooting process.
The most challenging thing about this error is that it is hard to find the cause(s) at play. Nonetheless, there are numerous solutions that you can try and test to find the problem’s root cause.
How to Fix the “Sorry, You Are Not Allowed to Access This Page” Error in WordPress
Though the long list of solutions may be a little intimidating for you, it covers a variety of solutions. You can choose the right one for yourself.
-
Deactivate all the plugins
An updated or newly installed plugin can cause the “Sorry, you are not allowed to access this page” error. One of the common solutions to troubleshoot this error is to deactivate all the plugins.
In the event, you won’t be able to access the admin dashboard. So, you’ll have to deactivate your plugins manually via FTP (File Transfer Protocol). Once done, check if you’re still facing the error. If not, you can start reactivating your plugins one by one, but keep checking each time if the error is re-occurring.
If the error returns, you can be sure (almost) that the last plugin you reactivated is the cause. You can simply deactivate that and remove it from your website.
If this process doesn’t work, try another fix.
-
Ensure that your database prefix is correct
Each MySQL database has a prefix. If the one listed in the files of your website does not match the one that is listed in phpMyAdmin, then you may encounter a “Sorry, you are not allowed to access this page” message.
This may occur while migrating your website, including if you were using a local staging website for development and are now shifting to a live server. To check for discrepancies, you will have to access your wp-config.php file.
You can do this using SFTP. Once you are in your wp-config.php file, look for your database’s prefix (the default would be “wp_”).
Then, log in to phpMyAdmin and take a look at the prefixes for the tables of your database. They should match the ones that are listed in your wp-config.php file. If they don’t, you’ll have to make the changes so that they do.
-
Upgrade your website to the latest version of PHP
If your WordPress website is running the outdated version of PHP, this could be your trouble’s source and you need to upgrade PHP.
Even if upgrading your website to the latest version of PHP doesn’t troubleshoot the “Sorry, you are not allowed to access this page” error, it should improve your website’s overall security and performance. However, before you begin the upgrade process, create a backup of your website.
Once you have saved your backup, it is recommended to test whether your account is compatible with PHP’s latest version. You can do this with a
WordPress staging website.
Assuming that everything will go well, you can run the update.
-
Activate a default theme
Another potential cause of this error could be that you have recently installed or updated a theme. The best way to resolve this problem is to activate a default WordPress theme like Twenty Nineteen or Twenty Twenty.
To do this without accessing the admin area, you’ll have to use FTP again.
- Connect to your server using FileZilla
- Navigate to wp-content > themes
(The rest of the process is quite similar to the one we have described above for disabling the plugins)
- Rename the folder for your current (active) theme
- Go back to your website and log in
(Now, you should see a notification saying that the active theme is broken, and a default theme is reactivated)
- Now you can troubleshoot the theme.
Your website would at least be accessible, though with the wrong theme.
Conclusion
As a WordPress user, it is crucial to be familiar with common errors and their solutions. With the troubleshooting methods we have covered in this blog, you can confidently fix the “Sorry, you are not allowed to access this page” error. Feel free to experiment with different troubleshooting techniques to find the most effective solution for your specific situation.
For additional WordPress tips and guidance, make sure to explore
Bluehost’s WordPress tutorials. With our top-notch
WordPress hosting &
managed hosting services and valuable resources, you can optimize your WordPress website and overcome challenges that may arise.
Write A Comment