WordPress "Sorry, You Are Not Allowed to Access This Page": How to Fix It (2026)
You log in as the admin and WordPress shows: Sorry, you are not allowed to access this page. This means WordPress does not see admin permissions for your user. The login itself worked. The permissions are missing or unreadable.
The Short Version
- WordPress reads your permissions from the database. If it cannot find them, it blocks the page.
- The most common cause is a changed table prefix:
$table_prefixinwp-config.phpno longer matches the prefix used in the database tables. - Other causes are a plugin conflict, a changed user role, or a bad migration.
- Compare the prefix first, then check the role, then test plugins.
Why This Error Happens
WordPress stores a user’s role in the usermeta table under a key that starts with the table prefix, followed by capabilities. If the prefix in wp-config.php is different from the prefix in the database, WordPress looks for the wrong key and finds no permissions.
- A migration or restore used a different prefix.
- Someone changed
$table_prefixwithout renaming the tables. - A security or role plugin changed the roles.
- The user’s role was changed to something lower than Administrator.
Step 1: Compare the Table Prefix
- Open
wp-config.phpand find the line$table_prefix = 'wp_';. - Open phpMyAdmin and look at your table names, for example
wp_usersorabc_users. - If they differ, set
$table_prefixinwp-config.phpto the prefix the tables really use.
Changing the config to match the tables is safer than renaming database rows. Take a backup before you change anything.
Step 2: Check the User Role
If another administrator can log in, ask them to open Users and set your role to Administrator. If you use WP-CLI, run wp user set-role yourusername administrator.
Step 3: Test for a Plugin Conflict
Rename the plugins folder inside wp-content to plugins-off, then try the admin page again. If it works, a plugin is the cause. Rename the folder back and follow our plugin conflict guide.
Step 4: Restore a Backup
If you changed the database by hand and it got worse, restore your backup and start again with Step 1. If you cannot log in at all, our locked out guide helps with passwords.
How to Avoid It
- Do not change the table prefix on a live site unless you know how to update every row.
- Back up before a migration.
- Keep a second administrator account for emergencies.
Verified Facts and Sources
Checked in December 2026. The WordPress developer documentation explains roles and capabilities, and documents the $table_prefix setting in wp-config.php. WP-CLI provides a user set-role command.
- Roles and Capabilities (WordPress developer documentation)
- Editing wp-config.php (WordPress developer documentation)
- wp user set-role (WP-CLI documentation)
Frequently Asked Questions
Why can I log in but not open admin pages?
Your password is correct, so login works. WordPress then checks your permissions. If it cannot read them, it shows this message.
Can a plugin cause this error?
Yes. A security or role plugin can change roles or block admin pages. Rename the plugins folder to test.
Is it safe to change the table prefix in wp-config.php?
Only if it matches the prefix the tables already use. Changing it to a different value without renaming the tables will cause this error.
What if I have only one admin account?
Fix the prefix first. If that does not work, use phpMyAdmin or WP-CLI to set your role, or restore a backup.
Updated December 3, 2026.
More WordPress Error Fixes
- 500 Internal Server Error: Fix the 500 error
- Critical Error on This Website: Fix the critical error message
- White Screen of Death: Fix the blank white page
- Database Connection Error: Fix Error establishing a database connection
- Memory Limit Error: Fix Allowed memory size exhausted
- Update Failed: Fix a failed WordPress update
- 404 After Changing Permalinks: Fix pages showing 404
- Parse and Syntax Error: Fix parse errors from code edits
- Maximum Execution Time Exceeded: Fix timeouts
- Locked Out of WordPress: Reset your admin password
- Headers Already Sent: Fix the headers already sent warning
- Plugin Conflict: Find the plugin causing the problem
- Too Many Redirects: Fix ERR_TOO_MANY_REDIRECTS
- Login page refreshing: fix the wp-admin redirect loop
- Mixed content error: fix the Not Secure warning after HTTPS
- Fatal error after PHP update: roll back and fix safely
- WordPress not sending emails: fix contact form and reset mail
- Stuck in maintenance mode: delete the .maintenance file
- Missed schedule posts: fix scheduled posts not publishing
- REST API error: fix the Site Health warning
- Plugin could not be activated: fix the fatal error on activation
- Link you followed has expired: fix theme and plugin upload failures
- Another update in progress: remove the update lock