How to Fix the WordPress "Sorry, You Are Not Allowed to Access This Page" Error
parallax background

How to Fix the WordPress “Sorry, You Are Not Allowed to Access This Page” Error

How to make a WordPress mega menu
July 6, 2024
Great looking technology websites you should check out
July 10, 2024
How to make a WordPress mega menu
July 6, 2024
Great looking technology websites you should check out
July 10, 2024
 

Encountering the "Sorry, you are not allowed to access this page" error in WordPress can be frustrating, especially when you need immediate access to your site. This common issue often stems from permissions errorsuser roles misconfigurations, or conflicts in wp-config.php. As a seasoned web designer, I understand the urgency and complexity of these problems.

You will learn how to fix the WordPress "Sorry, you are not allowed to access this page" error efficiently. This guide covers practical steps, from checking WordPress user roles and permissions settings to troubleshooting plugin conflicts and examining your wp-admin access. By the end, you will be equipped to address this error and regain control over your WordPress dashboard.

This article will dive into:

  1. Diagnosing permissions errors and role management.
  2. Resolving plugin and theme conflicts.
  3. Adjusting wp-config.php settings.
  4. Utilizing FTP and cPanel for deeper fixes.

Let's restore full functionality to your WordPress site effectively.

What Does the Error Even Mean?

As it is, the error message isn't too helpful, but it suggests that there is a mismatch between the website files and the database. Data on the page you're trying to access can be inappropriate because of a recent change in WordPress’ core, a faulty plugin, or an outdated theme. The data cannot be processed and causes WordPress to get stuck, resulting in WordPress' Sorry, You Are Not Allowed to Access This Page error. To fully understand it, you have to figure out what causes it in the first place.

What Is the Cause Behind “Sorry, You Are Not Allowed To Access This Page”?

 

The underlying reason for the error often has to do with permission issues, which can be tricky to identify without some troubleshooting. For instance, if the data generated by a theme or a plugin is not recognized or cannot be handled properly by WordPress, the request will simply fail and you will see this cryptic error page.

The same situation can happen when your wp-config.php details are not matched with the database. Another potential reason why this error appears is running an outdated PHP version. Updating PHP should solve the issue in this case, but to be absolutely sure, it's best to follow the troubleshooting steps below.

How Can You Fix the WordPress “Sorry, You Are Not Allowed To Access This Page” Error?

Before starting the troubleshooting process, create a backup of your site. This will help you to restore the website if something goes wrong while troubleshooting. Skipping this step can ruin your website and will require twice the work to get it fixed.

Revert your latest changes

 

If you clearly remember what you did just before the WordPress Sorry, You Are Not Allowed to Access This Page error popped up, it is very likely that it was caused by this action. For instance, updating from one WordPress version to another can cause database issues that may lead to the error.The easiest way to solve this issue is by reverting your website manually to a previous version.

Similarly, the issue can also occur after installing a new theme or plugin. If the error appeared immediately after installation, one of them is surely at fault and uninstalling the theme or plugin should bring the website back to normal.

Use WP_Debug

The WP_Debug tool can list all the PHP errors that are encountered by your website. Navigate to wp-config.php and copy & paste this line of code:

define( ‘WP_DEBUG’, true );

Save the file and you will be able to see an extensive list of debug messages when you access your site again. You can now see which message triggered the WordPress Sorry, You Are Not Allowed to Access This Page error and fix it accordingly.

Check your server's access and error logs

 

Similarly to using the WP_Debug tool, you can also verify the access and error logs of the server itself. These logs are more detailed, and they can help you prevent further guesswork. See your hosting provider's documentation on how to find your server's access and error logs. Usually, they are stored in the /var/log directory, but this can differ among hosts.

Look for plugin security notifications

 

If you’ve received plugin security notifications that you ignored at the time, they might be the reason behind the WordPress Sorry, You Are Not Allowed to Access This Page error. Check your current and old emails twice to see whether you have to update your plugins or not. Don’t overlook your spam folder either.

Check the file permissions

 

Incorrect file permissions are a common cause of Sorry, You Are Not Allowed to Access This Page messages. You need to use an FTP program and the details provided by your web host. Locate the public HTML folder and look for the wp-admin and wp-content subfolders. Highlight the folders, right-click them, and select the correct permission attributes recommended by WordPress.

Deactivate your themes/plugins

 

The Sorry, You Are Not Allowed to Access This Page problem can be caused by themes or plugins. If the theme is faulty, access your server using an FTP program and go to the themes folder, located in wp-content. Rename the folder and refresh the broken page. If the problem is fixed, the theme you are using is the cause.

Conversely, if you access the plugin folder and rename it, following the same steps as above and the website works, you will have to figure out which is the faulty plugin from the list. To do that, deactivate each plugin manually and refresh the website after each deactivation. This way, you will find the plugin that caused the problem and you can delete or fix it.

Reset the .htaccess file

 

Using an FTP program, navigate to the .htaccess file in the root WordPress directory. Download and keep a copy of the file safely on your computer. After that, you can edit the file back to its defaults, save it, and then re-upload it to the server. Now go back to your website and see if the issue is resolved.

Update your site’s PHP

 

As mentioned before, your site’s PHP can be the reason behind receiving this error message. The problem can be easily fixed. Check if the PHP version is compatible with your WordPress version. If not, download the appropriate version of PHP and install it. With shared hosting, you may need to contact your hosting provider to do so.

Check the database prefix

 

When the PHP version is not the problem, you should check the database prefix. To do this, open the wp-config.php file and check the value of the prefix. The prefix is usually wp- and it should match the one used in the database. If you notice any discrepancies between the two, correct it and the Sorry, You Are Not Allowed to Access This Page message should disappear.

Reset the website

If none of the solutions provided above work yet you are still stuck with a WordPress Sorry, You Are Not Allowed to Access This Page error, the only option you have is to fully reset the website. Export all of your content, store it safely, and install WordPress again manually. After the installation, import your content back and see if the error disappears. If you are planning to change some URLs to benefit your needs, follow this guide to have a smooth site migration process without losing your rankings.

Other options

 

You should also keep in mind that your WordPress settings might be faulty as well. Export your setting preferences so that you can restore them after troubleshooting. Reset the settings to their default form and see if the problem goes away. If yes, you know where to look for the issue.

FAQ on this error

How can I resolve the "Sorry, you are not allowed to access this page" error in WordPress?

Check your user roles and permissions settings in the WordPress dashboard. Ensure your account has the Administrator role. If you still can't access, there might be a plugin conflict. Disable all plugins via FTP or cPanel and try again.

Why can't I access the wp-admin area?

Your wp-admin access might be restricted due to permissions errors or issues in your wp-config.php file. Plugins or themes can also cause conflicts. Try accessing via a different user account or disable recent plugins via FTP.

How do I fix WordPress permissions errors?

To fix permissions errors, navigate to wp-config.php and ensure proper user roles are set. Check the file permissions via FTP. They should generally be set to 755 for directories and 644 for files.

Is there a way to resolve this error without accessing wp-admin?

Yes, access your site via FTP or SFTP. You can manually disable plugins by renaming the plugins directory. Also, modifying wp-config.php and .htaccess through FTP or cPanel often resolves issues.

Can changing themes cause this error?

Yes, an incompatible or corrupt theme can lead to access issues in WordPress. Change your theme via wp-config.php or phpMyAdmin by modifying the database. Revert to a default theme like "Twenty Twenty-One."

How can plugins impact my ability to access WordPress?

Plugins can conflict with user roles or file permissions. Disable all plugins by renaming the plugins folder using FTP. Reactivate them one by one to identify the culprit. A security plugin might be overly restrictive.

Does my hosting provider affect this error?

Absolutely. Improper server configurations by your hosting provider can cause access errors. Contact your host for assistance in adjusting server settings or restoring file permissions. Providers like Siteground and Bluehost often give quick support.

Is my database connected to this error?

Your database connection might be problematic. Check wp-config.php for correct database credentials. Use phpMyAdmin to ensure your WordPress database is intact. Repairing the database might resolve the access issue.

How do I reset WordPress file permissions?

Via FTP or hosting cPanel, navigate to your WordPress installation directory. Change directories' permissions to 755 and files' to 644. Correct permissions can resolve access issues immediately.

What to do if all else fails?

If all standard troubleshooting fails, revert to a previous backup of your WordPress site. Use a Backup plugin or your hosting provider's backup service. Restoring to a known good state often solves complex, unresolved errors.

Conclusion

Solving the "Sorry, you are not allowed to access this page" error in WordPress is crucial for site management. Check user roles and permissions in the WordPress dashboard to ensure admin rights. Disable plugins and themes via FTP or cPanel to identify conflicts. Verify wp-config.php settings, correct file permissions, and restore accessibility.

Steps recap:

  • Inspect User Roles: Ensure correct permissions.
  • Disable Plugins: Use FTP to rule out conflicts.
  • Themes Check: Revert to default themes if needed.
  • File Permissions: Set directories to 755 and files to 644.
  • Backup Restoration: If all else fails, revert to a previous backup.

By following these steps, fixing the WordPress "Sorry, you are not allowed to access this page" error becomes manageable. Proper permissions settings, attention to plugin conflicts, and careful management via FTP or cPanel ensure a smooth resolution. Return control of your site's admin dashboard and restore functionality efficiently.

If you enjoyed reading this article on how to fix the WordPress sorry, you are not allowed to access this page, you should check out this one about how to fix the WordPress missing a temporary folder.

We also wrote about a few related subjects like WordPress stuck in maintenance mode, fixing the defer parsing of JavaScript, cannot login to WordPress, WordPress publishing failed, jQuery is not defined and how to fix the http error when uploading images to WordPress.

Albert Ślusarczyk
Albert Ślusarczyk
As the co-creator of Be Theme, I am a strong believer in designing with care and patience. I pour my energy, time & knowledge into perfecting the theme for our 260,000+ customers.
Siteground Hosting