What does this error mean?
Do you see “Sorry, you are not allowed to access this page” when you try to log in to your WordPress dashboard? That can be alarming. This message means WordPress is blocking your access to a specific page or section. It’s a security measure — WordPress believes you don’t have the correct permissions for that action. If you’re the site owner, that’s obviously wrong, and it becomes a frustrating problem. The message often appears right after a change or update, for example after updating a plugin, theme, or WordPress itself.
In plain language WordPress is saying: “You don’t have permission to view this page.” The good news is your website is usually still intact. You’re just locked out of (part of) the WordPress admin. Below I explain what causes this error and — more importantly — how to regain access.
Possible causes of this error
There isn’t a single cause. In practice this message appears due to one of the following issues:
- Incorrect user role or permissions: WordPress no longer recognizes your account as an administrator. Your role may have been changed or corrupted, so you lost admin rights. This is common in multisite environments but can also happen on single sites.
- Plugin or theme conflict: a recently installed or updated plugin or theme can cause the error. If code or version info doesn’t match the database, certain requests can fail. Some security plugins can also lock you out by mistake.
- Misconfiguration after update or migration: sometimes files and database get out of sync. For example you updated WordPress or a component but the database wasn’t updated properly. Or after a site migration, the database prefix in
wp-config.phpdoesn’t match the database tables. That mismatch can trigger this error. - Incorrect file permissions: every file and folder has permissions that determine who can read or modify it. If permissions are wrong, WordPress can block access to certain parts of the site. Overly strict permissions on WordPress files (
wp-admin,wp-content, etc.) can cause this specific error. - Outdated PHP version: if your site runs on an old PHP version, WordPress may call functions that don’t exist, which can trigger errors. In some cases the “Sorry, not allowed” message appears if PHP is very outdated.
- Cache or cookie issues: less common, but sometimes it’s your browser. An outdated login cookie or cached admin page can cause permission issues. For example: you were logged in, ran an update, and the session became invalid — WordPress no longer sees you as admin and shows the error.
These situations (or combinations) explain the error in 99% of cases. It usually comes down to something that confuses your admin permissions — a plugin, theme, update, or configuration issue. Below are step‑by‑step fixes for each cause.
Solutions: regain access step by step
I’ll cover different solutions to fix the “Sorry, you are not allowed to access this page” error. Start with step 1 and continue as needed. Tip: before making major changes, it’s always smart to create a backup (if you don’t already have automated backups). That way you can roll back if something goes wrong.
Tip: sometimes the fix is simpler than you think. Log out completely and log back in. Try another browser or a private/incognito window. Clear your browser cache and cookies. If the issue was caused by session cookies or caching, this often resolves it. If not, continue with the steps below.
1. Check that your account has administrator rights
A common cause is that your account no longer has the administrator role. WordPress then thinks you’re a regular user without access to wp-admin. So you need to confirm your role.
The easiest way is to check the database via phpMyAdmin (usually available in your hosting control panel). In phpMyAdmin, open the wp_users table and find your username. Note your user ID (e.g., 1). Then go to the wp_usermeta table and locate the row with meta_key wp_capabilities for your user ID. The meta_value should show that you are an administrator.
On a single site, the correct value looks like this:
a:1:{s:13:"administrator";s:1:"1";}
If you see something else — or nothing — your account doesn’t have admin rights. Fix it by editing that row and setting meta_value exactly to the value above. Save the change and try logging in again.
If you can’t adjust the existing user, you can also create a new admin account in phpMyAdmin. Add a user in the wp_users table (unique ID, login, email, password hash) and then add a row in wp_usermeta with meta_key wp_capabilities and the admin value above. Log in with the new account to regain access.
Advanced: if you have server access and WP‑CLI, you can quickly create an admin with wp user create. Another option is to temporarily add a PHP snippet to your theme’s functions.php that creates an admin user. Remember to remove that code once you can log in. These methods are only recommended if you’re comfortable with WP‑CLI or editing code.
2. Deactivate plugins (via FTP or file manager)
If step 1 didn’t help, a plugin is likely the culprit. Plugins can affect WordPress permissions. Maybe you installed or updated a plugin recently and got locked out. In that case, disable plugins without using the dashboard.
Use FTP or your hosting file manager and go to /wp-content/plugins.
The simplest method is to temporarily rename the entire plugins folder. For example, rename plugins to plugins_off. WordPress can’t load any plugins then, so all plugins are deactivated. Try logging in to wp-admin again.
If you can log in now, a plugin caused the issue. Rename the folder back to plugins. Your plugins will still be deactivated in WordPress. Go to Plugins and re‑activate them one by one, testing access each time. Tip: start with the plugin you updated or installed just before the error appeared. Eventually you’ll find the plugin that caused it. Remove or replace that plugin if you can’t update or configure it properly.
If you still get the error after renaming the plugins folder, rename it back to plugins so your plugins load again. The cause is likely elsewhere — proceed to the next step.
3. Switch temporarily to a default theme
If plugins aren’t the cause, your active theme is the next suspect. Custom or outdated themes can cause conflicts after updates. Again, you can switch themes without wp-admin via FTP or file manager.
Go to /wp-content/themes. Find your active theme folder (e.g., twentytwentytwo) and rename it, for example add _off: mytheme_off. WordPress won’t find the active theme and will fall back to a default theme (like Twenty Twenty‑One).
Log in again. If you can now access wp-admin, your original theme is the issue. Consider recent changes: did you update the theme or add custom code? Roll back those changes or contact the theme developer for support.
Once you can access the dashboard, you can activate a different theme or reinstall the problem theme. If renaming the theme doesn’t help, rename it back and continue to the next step.
4. Check file permissions on WordPress folders
As mentioned earlier, incorrect file permissions can block access. Your WordPress install should have standard permissions so admins and scripts can work correctly.
Check permissions via FTP or your hosting control panel. Connect to your server and go to the WordPress root (often public_html). Focus on wp-admin, wp-content, and wp-includes.
Set folder permissions to 755 and file permissions to 644. In FileZilla, right‑click a folder → File permissions, enter 755, apply to subfolders, and apply to folders only. Then select all files (not directories) and apply 644.
These values are WordPress defaults. If permissions were too strict, this fixes them. Try logging in again.
Note: some hosts have a “Fix Permissions” tool in the control panel, which can do this for you if you prefer not to use FTP. If permissions are correct and the error persists, continue.
5. Make sure you’re running a recent PHP version
If your site runs on an old PHP version, WordPress may break. It’s recommended to keep PHP updated — for security and performance.
You can usually change PHP version in your hosting panel (cPanel or a custom panel). Choose at least the version required by your WordPress and plugins — currently PHP 8.x is recommended. Update PHP and try logging in again. If PHP was the bottleneck, the error should be gone.
(If you’re unsure whether your site is compatible with the latest PHP, ask your host. Most sites are fine and benefit from the upgrade.)
6. Check the database prefix in wp-config.php (after migration)
This step is more technical and mostly relevant if you recently migrated the site or manually edited the database. In wp-config.php you’ll find $table_prefix. It must match your database table prefix. The default is wp_, but some sites use a custom prefix for security.
If the prefix in wp-config.php doesn’t match your actual table names, WordPress can’t read user permissions and may block access. Check your table names in phpMyAdmin (do they start with wp_ or something else?) and compare to $table_prefix.
If they don’t match, either update wp-config.php to the correct prefix or rename the database tables to match. Only do this if you’re experienced — mistakes can break the site. Always back up first.
Once the prefix matches, try logging in again. If this was the issue (common after migrations or clones), the error should disappear.
7. What if none of the above helps?
If you’ve tried everything and still see “Sorry, you are not allowed to access this page,” there are a few last‑resort options:
- Restore a backup: if you have a recent backup from before the problem, restoring it will likely regain access. You’ll lose changes since then, but you can then repeat updates step by step to see where it breaks.
- Contact your host: many hosts will help with issues like this. They can check server logs or review file permissions and settings. Sometimes the error is a symptom of a deeper server issue.
- Hire a WordPress expert: if you’re stuck or the steps feel too complex, get professional help. Developers and WordPress support services see this often and can usually resolve it quickly.
Conclusion
Being locked out of your own WordPress site is frustrating, but with the steps above you can usually fix “Sorry, you are not allowed to access this page.” It’s typically a permissions issue or a conflict that can be resolved with some careful troubleshooting. Hopefully you now have access to wp-admin again and can continue working on your website.