WordPress: Sorry, you are not allowed to access this page.
Your user role lacks the capability for that admin screen — or the database table prefix / user capabilities are out of sync after a migration.
Seen on:
WordPress
Meaning
WordPress stores roles in {prefix}user_roles and each user’s capabilities in {prefix}capabilities meta. Changing $table_prefix without renaming these option/meta keys makes even admins lose access.
Common causes
- User role really lacks the capability
- Plugin page removed/renamed after deactivation (old bookmark)
$table_prefixchanged but option/meta keys still use the old prefix- Security plugin restricting admin pages
- Multisite: user not a member of that site
⚡ Quick fix
- Check the user’s role in Users
- Go to the dashboard instead of an old plugin URL
- After a prefix change, update
{prefix}user_roles,{prefix}capabilitiesand{prefix}user_levelkeys - Grant admin via WP-CLI
Detailed fix by platform
WordPress
- Restore administrator role with WP-CLI:bash
wp user list --fields=ID,user_login,roles wp user set-role admin administrator wp option get wp_user_roles --format=json | head -c 200 # replace wp_ with your prefix
How to diagnose
- Role — What role does the user have?
- URL — Valid admin page?
- Prefix — Does $table_prefix match the role/capability keys?
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026