WordPress 'Sorry, You Are Not Allowed to Access This Page' Fix (2026)
Disclosure: some links on this page are affiliate links. We may earn a commission at no extra cost to you. How we test and rate hosts.
You log in successfully - then wp-admin greets you with "Sorry, you are not allowed to access this page." Authentication works; authorization broke. Your account lost its capabilities. Three real causes: a plugin conflict, a table-prefix mismatch after migration, or a hacked demotion. Diagnose in this order.
Step 1: Rule Out a Plugin (2 Minutes)
Via FTP, rename wp-content/plugins to plugins_off and reload wp-admin. Dashboard opens? A plugin - usually a role editor, security, or membership plugin - corrupted capabilities. Rename back, reactivate one by one. Still blocked? Keep going.
Step 2: Check the Table Prefix (Post-Migration Cases)
Capabilities are stored in the usermeta table with keys named after the table prefix: wp_capabilities for the default wp_ prefix. If your tables were renamed (to abc_ during a migration or security hardening) but wp-config's $table_prefix was later changed back, or the rename was partial - every role silently disappears.
- Open wp-config.php - note
$table_prefix(e.g.,'abc_') - In phpMyAdmin, open
[prefix]_usermetaand look at the meta_key values - Keys say wp_capabilities but prefix is abc_? Update them: meta_key must be
abc_capabilities,abc_user_level, etc.
Step 3: Check for a Hack
In phpMyAdmin open [prefix]_users. Unknown administrator accounts, or your account missing? Compromised. Then check your row in usermeta - the capabilities value should exist. If a hacker demoted you, fix the site properly before restoring access or they'll do it again: hacked site recovery.
Step 4: Restore Admin via phpMyAdmin
- 1.In wp_users, find your user ID
- 2.In wp_usermeta, find the row: user_id = yours, meta_key = [prefix]_capabilities
- 3.Set meta_value to:
a:1:{s:13:"administrator";b:1;} - 4.Set the matching [prefix]_user_level row to 10. Reload wp-admin.
Step 5: Create a Fresh Admin via WP-CLI
Cleaner than editing serialized data - if your host offers SSH/WP-CLI:
wp user create rescueadmin you@site.com --role=administrator --user_pass=StrongPass123
Log in as the new admin, then fix or delete the broken account from Users > All Users.
Related Errors
Redirected to login instead of an access-denied message? That's a session problem: login redirect loop fix. Seeing a permission warning on a specific file operation: 403 Forbidden fix.
Support That Opens phpMyAdmin With You
Bluehost's 24/7 phone support walks you through database fixes like this - $3.99/mo, free domain, free migration.
Get Bluehost from $3.99/moWhat are you building?
Tell us about your project so we can match the perfect hosting plan.
Hosting Cost Calculator
See exactly how much you'll spend on hosting over time. Compare Bluehost vs popular alternatives and discover your potential savings.
Used to calculate transaction fees (Shopify charges 2% on sales)
Frequently Asked Questions
Why does WordPress say I'm not allowed to access the page?
You're authenticated (logged in) but your user account lost the required capability - usually the administrator role broke. Causes: a plugin conflict, a changed database table prefix (wp_ to something else) without updating the meta keys, a failed migration, or a hack that demoted your account.
Did my site get hacked?
Possibly - hacks commonly create rogue admins and strip yours. Check wp_users in phpMyAdmin: unknown administrator accounts = compromise. But plugin/theme updates cause this error far more often than hacks.
The error appeared after changing the database table prefix - why?
Roles are stored in wp_usermeta with the prefix baked into the key name (wp_capabilities). If you renamed tables to abc_ but the meta key still says wp_capabilities, every user loses all roles. Rename the keys to match the new prefix.
How do I restore admin access?
Via phpMyAdmin: find your user ID in wp_users, then in wp_usermeta set wp_capabilities to a:1:{s:13:"administrator";b:1;} and wp_user_level to 10. Or create a new admin via a mu-plugin or WP-CLI: wp user create newadmin email@site.com --role=administrator.
Can a plugin cause this?
Yes - user-role editors, security plugins, and membership plugins modify capabilities. Rename wp-content/plugins via FTP to plugins_off; if wp-admin opens, reactivate one by one to find which plugin strips roles.
Will reinstalling WordPress fix it?
No - capabilities live in the database, not the files. Reinstalling wp-admin files does nothing. Fix the usermeta keys or add a fresh admin via WP-CLI.
Ready to launch?
Get Bluehost from $3.99/month with a free domain, free SSL, and 30-day money-back guarantee.
Related Articles
Bluehost vs Competitors: The Technical Deep Dive
We ran 47 benchmarks over 90 days. Here's the raw data on why Bluehost dominates.
Fix ERR_TOO_MANY_REDIRECTS in WordPress (2026): The 6 Real Causes
ERR_TOO_MANY_REDIRECTS means an infinite redirect loop. Match your Site URLs, fix Cloudflare SSL mode, reset .htaccess, kill plugin conflicts - step-by-step with code.
WordPress 403 Forbidden Error: 7 Fixes That Actually Work (2026)
403 means the server understood you but refuses to serve the page. Fix file permissions (755/644), regenerate .htaccess, kill security plugin blocks - in the right order.
Fix 502 Bad Gateway in WordPress (2026): Diagnose First, Then Fix
502 means the gateway got a bad response from your server - usually PHP timeouts, CDN issues, or overload. A 9-step diagnostic workflow from browser checks to server logs.
Fatal Error: Maximum Execution Time Exceeded - 6 Fixes (2026)
max_execution_time kills slow updates at 30-60s. Fix the culprit plugin/theme first, then raise the limit via wp-config, .htaccess or php.ini - with exact code.
HTTP Error Uploading Images in WordPress: 9 Fixes Ranked (2026)
The vague 'HTTP error' on image upload usually means memory limits or Imagick. Fix order: rename the file, bump memory, force GD library, check permissions - with code.