How to fix the “We’re sorry you’re not allowed to access this page” error.

Is your WordPress website encountering the “Sorry, you are not allowed to access this page” error? 🤔

We are sorry that you do not have permission to access this page‘ is a common WordPress error that occurs when you try to access a restricted page in your WordPress dashboard.

The restricted page can be a post, a setting, a menu, or even the main dashboard page in some cases.

Not having access to the dashboard is alarming, but there’s no need to panic. With a little effort, you can fix the error and get your website back up and running in no time.

All you have to do is Try the solutions listed below In this article. 😎

Let’s begin.

What is the “We’re sorry, you’re not allowed to access this page” error? And why does it occur? 🧐

We are sorry that you do not have permission to access this page

As the name suggests, the error “We’re sorry, you’re not allowed to access this page” appears on a WordPress site when you try to access a page that you don’t have permission to view (or that WordPress thinks you’re not allowed to see it, possibly due to a misconfiguration).

Sometimes this is by design, as WordPress intentionally restricts what users with different roles can do.

👉 For example, if your WordPress account has the author role, you cannot access the interfaces to install plugins or themes.

This is intentional behavior, in which case the “We’re sorry you’re not allowed to access this page” message isn’t really an error. You may need to contact the site administrator to ask them to update your account if you feel you should be able to access these areas.

However, this issue can become an error if you see this message when trying to access dashboard panels that you are using should have access to.

👉 For example, if you’re seeing this message as a site admin, that’s a pretty good sign that something went wrong.

The error sometimes occurs after you update a plugin, theme, or WordPress core. This is because the data stored in the plugin, theme or WordPress core does not match the data stored in your website’s database.

Think about it like this: You may be assigned as an administrator in the database, but the software you just updated sees you as a subscriber and prevents you from accessing the settings page. In this case, you will see the error “Sorry, you do not have permission to access this page” on your website.

Other possible causes include running outdated PHP versions, file permission issues, incorrect credentials in your wp-config.php file, and more.

Regardless of why the error occurred, you can remove it from your website by following the steps in the next section. 👇

How to fix Sorry, you don’t have permission to access this page error 🔧

Fixing the “Sorry, you are not allowed to access this page” error is time-consuming as a number of reasons may have led to the error. You may have to try many solutions before finding the root of the problem.

But first, make sure you have a backup of your entire website. Running some of the solutions in this tutorial could cause further damage. In this case, a backup acts as your safety net. You can quickly restore your site and keep trying the solutions.

IMPORTANT: Speaking of backups, if you’re making daily backups, try restoring your site’s most recent backup. This often fixes the error and you’ll be back to managing your site in no time. The only downside here is that you will lose any work you have done on your website between the last backup and when the error occurred.

Now let’s start.

  1. update website
  2. Try a different browser and clear the cache
  3. Set the right user roles
  4. Disable plugins & themes
  5. Make sure the database prefix is ​​correct
  6. Correct file permissions
  7. Update to the latest PHP version
  8. Regenerate .htaccess file

1. Update site

The error may have been caused by a temporary problem that resolved itself. Refreshing the website may allow you to access the page. However, be sure to wait 2-3 minutes before refreshing the page.

2. Try a different browser and clear the cache

You can also try opening the URL in another browser like Safari, Firefox, Opera Mini, Microsoft Edge, etc. If the website opens successfully in another browser, your current browser will show you a cached version of the website. In this case, all you have to do is clear the cache to remove the error from your website. Here is a guide that will help you with that.

3. Set the right user roles

WordPress user roles

The error could occur because your user roles have been accidentally changed. Since the “We’re sorry you’re not allowed to access this page” error is preventing you from accessing the dashboard, you can ask other admins to set your user roles correctly.

If you or someone else still has access to the dashboard, you can change a user’s role by editing their profile in the user area of ​​your dashboard.

Change user roles

Alternatively, you can create a new admin user through phpMyAdmin and gain access to the site.

The phpMyAdmin is the database of your website. It stores a lot of information including your user roles. You can access phpMyAdmin to check if your user roles have changed.

4. Disable Plugins & Themes

If the error started appearing after you added or updated a theme or a plugin on your WordPress site, then the theme or plugin might be the culprit. Try disabling the software.

If you cannot access it plugins and subjects List in your dashboard to disable the extension from the dashboard, you can also manually disable plugins and themes using FTP or cPanel File Manager.

Open your hosting account and go to cPanel → File Manager → public_html → wp content. You should see one subjects and plugins folder.

If you want to disable a theme, go to the Themes folder. Choose the topicright-click, and then select Rename. Rename the theme to something else. Then check your site.

In the same way, disable the plugin you had installed or updated before the error started appearing on your website.

You can also try disabling all your plugins at once and check if the error is resolved. If this resolves the issue, you can reactivate your plugins one by one until you find the problematic plugin.

5. Make sure the database prefix is ​​correct

Migrating from another hosting server or a local server can also lead to the error “We’re sorry you’re not allowed to access this page”.

The migration causes discrepancies in your wp-config.php File. The most common discrepancy is changing the database prefix.

To fix the problem, you need to access the wp-config.php file, check the prefix, and then match it to the prefix listed in your database. We’ll show you how.

Step 1: Check the wp-config

Open your hosting account and go to cPanel → File Manager → public_html.

If your host doesn’t offer cPanel, you can perform similar steps over FTP as well.

You should find them wp-config.php File in the public_html folder. To open the file, right click on the file and select view.

View wpconfig file - sorry, you are not allowed to access this page error
Locate and view the wp-config file

Next you’ll see your database prefix, which looks something like this: $table_prefix = ‘wpcg_’;

This means that the configuration file assumes that our database’s prefix is ​​wpcg_. Now we need to access our database and check if the prefix there matches the one in the configuration file.

Database prefix in wpconfig file
Finding the database prefix in the wp-config file

A NOTICE: The default database prefix on a WordPress website is “wp_”. For security reasons we had to change the prefix on our demo page.

Step 2: Check database

Open your hosting account and launch phpMyAdmin, which you can do via cPanel if your host offers it.

On the left side of the phpMyAdmin page you should find a database option that you can use expand. Expanding the database reveals the prefix.

Database prefix in phpmyadmin
Checking the database prefix in phpMyAdmin

If it matches the prefix in the configuration file, your database prefix is ​​not causing the error.

If it doesn’t match, you need to edit the wp-config.php file and change the database prefix.

All you have to do is open the wp-config.php file by right-clicking on the file and selecting To edit. Then scroll down to database prefix and change it. Don’t forget to meet them Save on computer button before exiting.

Check your website to see if the “Sorry, you are not allowed to access this page” error is gone.

6. Correct file permissions

In some cases, website users encounter the error when the website’s file permissions have been tampered with. We recommend correcting the file permission immediately.

For an in-depth look, you can read our complete guide to WordPress file permissions. Here’s the quick version…

You need to install an FTP client like FileZilla and then connect your website to the client. This guide will help you with that.

After the connection is established, you should see a public_html Folder on FileZilla.

Inside the public_html folder you will find these folders: wp-admin, wp-content and wp-includes. Select all three folders, right click and click the change permission Possibility.

Select folder in filezilla
Change file permission of core WordPress files

Set permission as 755. And choose them Recursion in subdirectories and Apply to directories only Possibility. Beat those OK button to save your settings.

Change File Permission - Sorry, you do not have permission to access this page.  Mistake
Changing WordPress File Permission

Next, select all files and set the file permission on 644then select the Recursion in subdirectories and the Apply to files only Possibility. Save your settings and close FileZilla.

Then check if the error is gone from your website.

IMPORTANT: If changed file permissions were the cause of the error, it’s possible that your website was hacked and the file permissions were manipulated by hackers. Scan your website instantly with the help of a WordPress security plugin.

Selecting all files in FileZilla - Sorry, you are not allowed to access this page error
Select all files in FileZilla

7. Update to the latest PHP version

An outdated PHP version can also be a reason why you are seeing the error on your WordPress site. The process of upgrading PHP differs from hosting to hosting. We have a guide on how to update PHP on your WordPress site. Just look.

If your website is hosted with a hosting provider that we haven’t covered in this article, contact your provider and seek help.

8. Regenerate .htaccess file

Do you still see the error? Then maybe your .htaccess file is corrupted.

Here’s how

Go to your hosting account and open it cPanel → File Manager → public_html → .htaccess. Right click on the file and select it To edit.

Next, replace the contents of the file with the following text:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L] </IfModule>
# END WordPress

Save on computer the file and check if the error has been removed from the site.

That’s it! 🤩 We hope you enjoy theWe are sorry that you do not have permission to access this page” Error on your WordPress website. If not, contact your hosting provider and seek help.

Fix We’re sorry you’re not allowed to access this page error permanently 🏁

Fix the “We are sorry that you do not have permission to access this page” Error is not difficult, but time-consuming work. It can be difficult to pinpoint the exact cause behind the error, which is why you have to try each solution to find the right one.

To avoid any problems, make sure to create a backup of your website before trying any of the solutions.

Leave a Reply

Your email address will not be published. Required fields are marked *

Verified by MonsterInsights