“Sorry You Are Not Allowed To Access This Page” – 10 Easy Fixes

by

Sorry You Are Not Allowed to Access This Page WordPress Error Feature Image

So you’re ready to make some updates to your WordPress site.

Or you want to check the stats and comments on your latest blog post.

Or perhaps you’ve installed a shiny new plugin or just switched themes and you want to see your site in all its glory.

But lo and behold! Your screen flashes the dreaded message, “Sorry you are not allowed to access this page.

This frustrating WordPress error often sneaks up at the worst times! Now suddenly, you’re locked out, even if you are the site’s administrator. It’s like being locked out of your own house with no idea why. Thankfully, there are several steps you can take to regain access.

TL;DR: If you see the “Sorry you are not allowed to access this page” error on WordPress, first try refreshing the page and clearing your browser cache. Then, check your plugins, themes, file permissions, and database settings. Always backup your site before making any changes. To keep your site safe in the future, use a strong security plugin to prevent unauthorized changes.

Just remember, always backup your site before trying any fixes. This creates a safety net that ensures you can roll back any changes if needed.

1. Start from the basics

When facing the “Sorry you are not allowed to access this page” error in WordPress, it’s best to start with basic checks. Often, simple fixes can solve the problem.

First, try refreshing the page. Sometimes, this is all it takes.

If it doesn’t work, clear your browser cache and cookies. This helps remove outdated data that might be causing the error.

Clear Chrome browser cache and cookies

Next, try using a different browser to see if the problem persists.

If you suspect it might be a network issue, switch to a different network, like mobile data. This can sometimes bypass blocks you didn’t know were there.

Lastly, check your WordPress site’s error logs. They can show more details about what’s causing the issue. If these steps don’t work, you’re ready to explore other options.

2. Check your plugins

Plugins can sometimes cause the “Sorry you are not allowed to access this page” error. A new installation might have introduced the issue. If this happened after you added a new plugin, disable it to see if that solves the problem. To do that, use FTP or your web host’s file manager, like cPanel, and rename the plugin’s folder in the plugins directory.

If the error appeared after updating plugins, it could be due to conflicts. In this case, disable all plugins using FTP or your file manager. Then, turn them back on one by one, checking each time to see if the error returns. This helps you find the plugin causing trouble.

Once you know which plugin is causing the problem, replace it with a similar one. Also, let the plugin developers know about the issue, so they can work on a fix.

3. Activate a default theme

Changing your WordPress theme or installing a new one from another source can sometimes lead to the “Sorry you are not allowed to access this page” error. This can happen if the new theme isn’t fully compatible with your site.

To check if the theme is the problem, switch back to a default WordPress theme like Twenty Twenty-Two. You can do this through phpMyAdmin.

  • First, log into your phpMyAdmin and find your database.
  • Look for the table called wp_options.
wp_options table in phpMyAdmin
  • In this table, find the rows for template and stylesheet. Change their values to the name of a default theme, like twentytwentytwo.
phpMyAdmin theme value in wp_options

This should set your site to use a default theme and may help you regain access. If it works, you’ll know your original theme was the issue.

4. Check file permissions

Incorrect file permissions can also cause the “Sorry you are not allowed to access this page” error. This might happen if you changed the permissions by mistake or if a plugin did that without you knowing.

To fix this, you need to check your file permissions. Use FTP or your web host’s file manager to access your site files. Look at the permissions for each file and directory.

File permissions

For directories (folders), set the permissions to 755. For individual files, set them to 644. These settings help ensure that your site works correctly and prevent unauthorized changes. Once you’ve adjusted them, check if the error is resolved.

5. Check database prefix

The “Sorry you are not allowed to access this page” error can occur if your WordPress database prefix doesn’t match the one in your wp-config.php file. This often happens during site migration or when you merge a staging site with your live site.

To check this, first access your wp-config.php file using FTP or your web host’s file manager. Look for the database prefix, which usually appears as $table_prefix.

table prefix in wp-config.php

Next, log into phpMyAdmin and view your database to see the prefixes used for your tables.

tables in site database

Make sure the prefix in wp-config.php matches the one in your database. If they don’t match, edit the wp-config.php file to match the database prefix.

Always backup your site before making these changes. This ensures you have a safety net if something goes wrong. For seamless site migrations, consider using tools like MigrateGuru. And for reliable staging sites, use MalCare.

6. Ensure you are an administrator

The “Sorry you are not allowed to access this page” error might appear if you’re no longer listed as an administrator on your site. This can stop you from accessing your wp-admin dashboard.

To check this, use phpMyAdmin to look at your site’s database.

Find the table for users, often named wp_users.

Then, locate the corresponding roles in the wp_usermeta table.

Finally, check if your user role has administrator privileges. This means the wp_capabilities field must have the value a:1:{s:13:"administrator";b:1;} and wp_user_level field must have the value 10.

If you find you’re not an administrator, ask another admin to upgrade your user role.

If that’s not possible, you can change the role yourself using phpMyAdmin. Find your user ID in both tables and update the role value as mentioned earlier to make yourself an administrator again. Be careful with these changes to avoid mistakes.

7. Update to the latest PHP version

Since WordPress runs on PHP, using an outdated PHP version can cause the “Sorry you are not allowed to access this page” error. To keep your site running smoothly, check if your PHP version needs an update.

php version information on wp-admin site health tool

To do this, log into your hosting account and look for the PHP settings. Most hosts will show you the current version and offer an option to update PHP.

Before making any changes, always back up your site using MalCare. This ensures your data is safe if anything goes wrong. Even if updating PHP doesn’t fix the error, it’s important to stay up-to-date, as newer versions include critical security and bug fixes.

8. Check for changes to core WordPress files

The “Sorry you are not allowed to access this page” error can occur if core WordPress files are changed or corrupted. This includes files like .htaccess or wp-config.php. This might happen if you added code, installed a plugin that altered them, or if a hacker modified them to block access.

To inspect these files, use FTP or your web host’s file manager. Look for any suspicious code or changes that don’t seem right.

You have two options if there’s an issue with the .htaccess file. First, you can replace it with the default .htaccess code. But remember, this will erase any custom settings.

Or, rename the .htaccess file to disable it. If that gets you access to your wp-admin dashboard, reset your permalink settings to create a new .htaccess file.

There isn’t a default version to revert to for problems with wp-config.php. Instead, restore this file from a previous backup of your site. File integrity monitoring tools, like MalCare, are important to protect against hackers and unauthorized changes to your site files.

9. Restore your site

If you’re facing the “Sorry you are not allowed to access this page” error, restoring your site from a backup can be a solution. If you have recent backups, use them to bring your site back to an earlier version. This can undo recent changes that might have triggered the issue.

MalCare backups

Keep in mind, though, that restoring your site will remove any new content, products, or updates added after the backup. Before you proceed, weigh the pros and cons, and ensure you have the most recent backup at hand. Restoring can be an effective way to resolve the problem and get your site back in order.

We recommend using MalCare for this purpose. It automatically backs up your site and stores them off-site in an encrypted format. This ensures your site data is safe and secure without using up your site’s resources. Should disaster strike, its one-click restore feature saves you the hassle of recovering your site.

10. Contact your web hosting provider

So you’ve tried everything and still can’t resolve the “Sorry you are not allowed to access this page” error? It’s time to reach out to your web hosting provider. They often have experienced WordPress experts on their team who can help fix the issue.

Your hosting provider’s support team can access server settings and logs that you might not have. They can identify problems that aren’t easy to spot. They can then provide solutions tailored to your hosting environment. Don’t hesitate to contact them, as their expertise can get your site back up and running smoothly.

What causes the ‘Sorry you are not allowed to access this page’ WordPress error?

The “Sorry you are not allowed to access this page” message is more of a security notice than a typical error. For this article, we’ll call it an error to discuss ways to fix it. This message means you don’t have the required permissions to view that page.

If you are an administrator but still see this message, it’s a problem since admins should have full access. Or, if you’re not an admin, you may need to ask the site administrator for access.

This error can happen if WordPress doesn’t recognize you as the admin. It can also be caused by issues with the WordPress core, plugin, or theme updates, or incorrect site settings. Usually, this error prevents access to your wp-admin dashboard. So most fixes need to be done externally using FTP, your web host’s file manager, or phpMyAdmin.

How to prevent the ‘Sorry you are not allowed to access this page’ error?

Preventing the “Sorry you are not allowed to access this page” error involves a few proactive steps. These steps keep your WordPress site secure and stable.

  • First, use a security plugin like MalCare. It helps protect your site from hackers and stops unauthorized changes to your files.
  • Regularly backup your site so you have a safety net if anything goes wrong. MalCare can handle this for you, making sure your data is secure.
  • Perform site audits regularly. Check for changes to files, their permissions, and any suspicious activity like unauthorized installs.
WordPress security audit
  • Keep your site updated. This includes updating WordPress core, plugins, themes, and any other software related to your site.
  • Use staging sites to test updates before applying them on your live site. MalCare offers staging sites that can be seamlessly merged with your live site once you finish testing.
  • Use reliable tools like MigrateGuru when moving your site to a different host. This prevents any issues that might pop up during the migration process.

Final thoughts

Fixing the “Sorry you are not allowed to access this page” error on WordPress can seem tricky. But following the right steps will help you get back to your site. Start with simple checks and then move to more detailed fixes. Remember, maintaining control of your site is important, so don’t rush through the process. Take your time to figure out what went wrong so it doesn’t happen again.

For future safety, try using a security plugin like MalCare. It has features like a malware scanner, one-click malware removal, a smart firewall, and vulnerability scanning. They secure your site against unwanted changes and block hackers. MalCare also offers a backup feature that automatically saves your site’s data in a safe, off-site spot. This keeps your data secure without slowing down your site. With all these features, MalCare ensures your site is safe, secure, and always working efficiently.

FAQs

How to fix sorry you are not allowed to access this page in WordPress?

To fix the “Sorry, you are not allowed to access this page” error in WordPress, start by refreshing the page. You can also clear your browser’s cache and cookies. If that doesn’t help, try disabling recent plugins or themes with FTP to see if there’s a conflict. Check if the database prefix in wp-config.php matches your database. Make sure your user role is set as an administrator in phpMyAdmin. Also, update your PHP version and see if core files like .htaccess have been changed. If nothing works, restore your site from a backup or ask your web hosting provider for help. Always back up your site before you start fixing anything.

Why can’t I access my WordPress login page?

If you can’t access your WordPress login page, there might be several reasons. Check if there’s a plugin or theme conflict by disabling them with FTP. Your site’s file permissions may also have changed, making the login page inaccessible. Sometimes, your IP address might be blocked, so try a different network. An incorrect database prefix or a changed URL in the settings could also cause issues. It’s also possible that your site has been hacked, preventing access. Always start by clearing your browser cache and cookies and, if needed, contact your hosting provider for support. Remember to regularly backup your site to prevent further issues.

How do I clear the WordPress cache?

To clear the WordPress cache, you first need to determine if you have a caching plugin installed, like W3 Total Cache or WP Super Cache. Go to your WordPress dashboard, find your caching plugin, and use its options to clear the cache. Most plugins have a clear cache button on the main settings page. If you’re using a managed hosting provider like SiteGround or Bluehost, check their control panel for a caching option and clear it there. Additionally, clear your browser cache to ensure you’re seeing the latest version of your site. Always check your site afterward to confirm that the changes have taken effect.

Category:

You may also like


How can we help you?

If you’re worried that your website has been hacked, MalCare can help you quickly fix the issue and secure your site to prevent future hacks.

My site is hacked – Help me clean it

Clean your site with MalCare’s AntiVirus solution within minutes. It will remove all malware from your complete site. Guaranteed.

Secure my WordPress Site from hackers

MalCare’s 7-Layer Security Offers Complete Protection for Your Website. 300,000+ Websites Trust MalCare for Total Defence from Attacks.