Technical

WordPress 'Sorry, You Are Not Allowed to Access This Page' Fix (2026)

By Daniel Reyes•October 11, 2026•3 min read

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.

Our top pick for most WordPress sites
Bluehost: free domain, free SSL, 24/7 support, 30-day money-back guarantee.
Check Bluehost Deal →

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]_usermeta and 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. 1.In wp_users, find your user ID
  2. 2.In wp_usermeta, find the row: user_id = yours, meta_key = [prefix]_capabilities
  3. 3.Set meta_value to: a:1:{s:13:"administrator";b:1;}
  4. 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/mo
Find Your Perfect Hosting Plan

What are you building?

Tell us about your project so we can match the perfect hosting plan.

Question 1 of 425% complete
Interactive Tool

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)

Shopify Basic (3yr)
$1,044
Bluehost (3yr)
$444
You Save
$600
58% less than Shopify Basic

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.

Start for $3.99 →

Related Articles