10 Ways To Fix “Sorry, You Don’t Have Permissions To Access This Page” Error In WordPress

When working on your WordPress site, few things are as frustrating as encountering the “Sorry, you don’t have permissions to access this page” error. In addition to preventing you from making major changes to your site, it can also throw your hard work away.

But do not be alarmed! In this article, we’ll show you a variety of proven methods to fix this error. We will cover the following:

  1. Revert your site to the state before the error.
  2. Use to get a list of errors.
  3. Review your access and error log.
  4. Get security notifications with a plugin.
  5. Check your file permissions.
  6. Disable themes and plugins.
  7. Manually restore your file .htaccess.
  8. Update your site’s PHP to the latest version.
  9. Check your database prefix.
  10. Export or restore your WordPress site.

By the end of this article, you will be well prepared to fix this issue whenever it occurs. Now, let’s get to work!

What causes the error “Sorry, you do not have permissions to access this page”

When making changes to your WordPress site or trying to use it, you may occasionally encounter an error that looks like this:

Basically, this error occurs as a result of a security or permissions issue. However, trying to determine the root cause is where things can get tricky.

For example, there could be a discrepancy in the data being communicated between your website files and the database. If the data stored for a WordPress theme, plugin or core component does not match the version in the database, requests will not be processed correctly and the error message “Sorry, you do not have permissions to access this page” will appear. page”.

If the username or password in your file wp-config.php do not match the database, that can also trigger this error. Finally, another possible cause is if your site is using an outdated version of PHP. Therefore, it is highly recommended to get the current version of PHP (we will cover this later).

Throughout this article, we will guide you through some methods to resolve this WordPress error. We’ll start with the most basic methods that are most likely to fix the problem, before moving on to more advanced solutions that may work if the cause isn’t that obvious.

10 Ways To Fix “Sorry, You Don’t Have Permissions To Access This Page” Error In WordPress

Before attempting any of these methods, it is highly recommended that you make a . This will ensure that you can easily restore your site if you make a mistake while trying to fix this problem. With that in mind, let’s get started!

1. Revert your site to the state before the error

As with any other problem you’re trying to troubleshoot, it’s helpful to remember the last change you made to the site. After all, that change could have caused the error. It could have been anything from upgrading to a new version of WordPress, to migrating your site from a local environment, to making major changes to PHP. You’ll also want to consider the last plugin or theme you installed (or updated).

See also  How to embed Google Forms in WordPress

If you’re sure you know what the last change you made to your site was, a simple solution is to revert it. This could mean removing the theme or plugin that you think is causing the problem or using a plugin such as to restore a previous version. You can also restore your WordPress site from a backup if you have one that was created before the error first occurred.

At , all web hosting plans include automatic backups. Therefore, you can easily get a backup of your website files or MySQL databases using the section Files > Backups of the control panel.

In case you’re not sure what change you made could have caused the “Sorry, you don’t have permissions to access this page” error, you may find it helpful to have access to a list of probable causes. This brings us to the next method.

2. Use WP_DEBUG to get a list of errors

To get a read of PHP errors that may be causing problems on your site, you’ll need to enable the . To do this, open your file wp-config.php and add the following line of code (in case it’s not already included):

define( ‘WP_DEBUG’, true );

After you have done that, you will be able to see the debug messages generated by WordPress on the individual pages of your site. By reading them, you may be able to identify the cause of the “Sorry, you do not have permissions to access this page” error.

With WP_DEBUG enabled, you can also see the generated posts located in wp-contents/debug.log. This way, all errors will be displayed in one easy-to-find location.

3. Review your error log

In addition to checking for PHP errors within your files, you’ll also want to check your server’s error log. This process can help eliminate guesswork and narrow down the possible causes of the error.

Naturally, the process for reviewing your error log will vary depending on your hosting provider. If you have a plan here at , you can read our guide to checking your site’s error log, in which we detail how to use your error log. .htaccess to log errors, and we look at some of the most common types of errors that could be causing the “Sorry, you don’t have permission to access this page” message.

If you can’t detect a possible cause of this error via WP_DEBUG or your host’s error log, you can get more information using a security plugin.

See also  How to create a WordPress theme? 5 step guide using code

4. Get security notifications with a plugin

It is always possible that the error you are experiencing is due to a hacking attack or another attack. If you have a security plugin installed that sends email alerts when suspicious activity occurs (like ), you should check your email and spam folder. You might find a notification there that corresponds to the time the error first occurred.

If you don’t already have a solution for this, there are a number of great plugins that will allow you to keep track of all the activities that happen on your WordPress site. A good example is:

With this plugin you can track WordPress core and configuration changes, user profile updates, database modifications and much more. As such, it can serve as a useful tool in identifying the root cause of any “Sorry, you do not have permissions to access this page” errors.

5. Check your file permissions

Another possible cause of this problem is misconfiguration of the . There are several factors to consider to ensure your file permissions are correct. Here are two easy ways to resolve file permission errors.

If you have a web hosting plan at , there is an amazing tool that will do the job for you. It is located in the section Others > Fix File Ownership of the control panel. With a single click, the tool will locate and repair any file or directory with permission issues.

Another option to do the same task is via FTP. Open your and enter your host details in the relevant fields. Then go to public_html. Within that folder, you’ll need to highlight the subfolders named wp-admin, wp-content Y wp-includes. Then select file permissions:

In the window Change file attributes that appears, you will need to make sure that the numeric value is 755the box Repeat on subdirectories is marked and Apply only to directories is selected:

Choose okay to apply any changes. Then go back to public_html and select all the files inside the folder. Be sure to Exclude the three directories you have already modified. You will need to right click on the files and select the file permissions one more time:

In the next window of Change file attributescheck that the numerical value is 644the box Repeat on subdirectories is marked and Apply only to files is selected. Then press okay:

This process should resolve the file permissions error (if any). Also, make sure the basic permissions for your WordPress files are set correctly. To summarize, directory permissions should be 0755, while file permissions should be 0644.

See also  DNS files

6. Deactivate all themes and plugins

As we mentioned above, a newly installed or updated theme or plugin can cause the “Sorry, you do not have permissions to access this page” error. As such, a good strategy is to disable all plugins and your active theme. In case , you will have to deactivate your themes and plugins manually via FTP.

Once you have done that, check if the error is still occurring. If not, you’ll want to reactivate your theme and individual plugins one by one, checking each time to see if the error is back. When the error returns, you can be almost certain that the last theme or plugin you reactivated is the culprit. Then simply disable it again and remove it from your site.

However, if this process doesn’t work, keep your FTP client open. You will have to use it in the next method as well.

7. Manually reset the .htaccess file

If none of the above solutions worked for you, it could be a problem with the code in your . To fix it, go to your folder public_html using FTP and locate your file .htaccess. Right click on it, select Rename and change the name to .htaccess_backup.

Then right click on the file again and download it this time:

Open the file in your preferred text editor (such as TextEdit or Notepad). Change the name back to .htaccess and replace all the text in the file with the following code snippet:

# BEGIN WordPress RewriteEngine On RewriteBase / RewriteRule ^index.php$ – RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php # END WordPress

After that, save the file and upload it to your site. The file .htaccess it should now be reset, and the error should be resolved if this file was the problem.

8. Update your site’s PHP to the latest version

A common problem that can cause the “Sorry, you do not have permissions to access this page” error is an outdated version of PHP. Also, using an old version of PHP can create security risks for your WordPress site. For that reason, it’s worth updating regardless of whether this is the fix for the bug or not.

Before upgrading to the latest version of PHP, it’s important to make sure your site is compatible with it. Once you’ve done this, you’ll also need to make sure your WordPress site is backed up (if you haven’t already…

Loading Facebook Comments ...
Loading Disqus Comments ...