Black FridayCyber Monday 2026
13Days
21Hrs
28Mins
09Secs
Flat20% OFF

Our biggest sale of the year20% off the first payment on all maintenance plans. Code BF2026

Grab the deal
WordPress

“Sorry, You Are Not Allowed to Access This Page” in WordPress: Causes and Fixes

This 403 message means WordPress does not think your account may open that screen. Check your role, a changed table prefix, plugins and security rules.

wpallsolution 6 min read

The message “Sorry, you are not allowed to access this page” appears when WordPress decides that the account you are using may not open the admin screen you asked for. It comes with an HTTP 403 status and is a permission check, not a hack. The cause is usually simple: you are logged in as the wrong user, your role was changed, or WordPress cannot read your role after a migration because of a database table prefix mismatch. This guide checks those causes in order, starting with the safest.

Quick answer

First make sure you are logged in with the administrator account. Then check your role under Users. If you are an administrator and still locked out after moving or restoring the site, compare the table prefix in wp-config.php with the prefix of the database tables, because WordPress stores roles and capabilities under that prefix. Finally test plugins and security rules. Back up before you change database records.

How this guide was prepared: it is research-based. We read the WordPress source code listed under Sources, checked on October 23, 2026. We did not test your site, and editing user and role data is risky, so ask a developer if you are unsure.

What the message means

In WordPress’s admin code, the message “Sorry, you are not allowed to access this page.” is sent with a 403 status when the current user’s capabilities do not allow the requested admin page. WordPress keeps capabilities in two places that depend on your database table prefix: a user’s capabilities are stored in user meta under a key made of the prefix plus capabilities (for example wp_capabilities), and the list of roles is stored in the options table under the prefix plus user_roles. If the prefix in wp-config.php does not match the prefix used in those records, WordPress cannot find the role and treats the user as having no permissions.

The decision tree: why does WordPress refuse you?

Flowchart for the WordPress message you are not allowed to access this page: five questions about the account, role, migration, plugins and security rules
Five questions show why WordPress refuses access.
  1. Wrong account? Log in as the administrator (Step 1).
  2. Role not Administrator? Ask an administrator to change it (Step 2).
  3. Started after a migration, restore or prefix change? Compare the prefix (Step 3).
  4. Started after a plugin or role change? Test plugins and restore roles (Step 4).
  5. Only one screen is blocked? Check security and firewall rules (Step 5).

Symptoms and likely causes

What you seeLikely causeStart with
Message after logging in as a staff or client userThat user’s role does not include the capabilitySteps 1 and 2
Message for the original administrator after a moveTable prefix mismatch, so the role record is not foundStep 3
Message right after a plugin was removed or updatedA plugin that added roles or capabilities changed themStep 4
Only one plugin’s page is blockedThat plugin’s own access setting or a security ruleSteps 4 and 5
The dashboard and settings are blocked for everyoneRole data lost or a firewall ruleSteps 3 and 5

5 steps to fix “Sorry, you are not allowed to access this page”

Step 1: Check which account you are using

Log out, then log in again with the administrator username and password. It is easy to be logged in as an editor or a client account in another browser tab. Also test in a private window, which rules out confusion with another saved session.

Step 2: Check the user’s role

If you can reach Users → All Users, check the role of the account. Another administrator can change it from the user’s profile. With WP-CLI, wp user list --fields=ID,user_login,roles shows roles and wp user set-role <user> administrator sets one, after a backup. Only give the administrator role to people who need it; our guide on PHP2Shell and website security lists access control as a core habit.

Step 3: Check the table prefix after a move or restore

If the original administrator is blocked after a migration, a restore or a prefix change, open wp-config.php and note $table_prefix. Then open the database in your host’s database tool and compare it with the real table names (for example wp_users, abc_users). If you renamed the tables, the keys in the user meta table and the roles option also need the new prefix, so a record named wp_capabilities must become abc_capabilities, and the option wp_user_roles must become abc_user_roles. This is a delicate edit: take a backup first, or restore a backup taken before the change, or ask your host or a developer. See how to move WordPress to a new host for what a migration should include.

Step 4: Test plugins and roles added by plugins

Plugins that manage roles, memberships, shops or user access can change capabilities, and removing one can leave users without the capability they relied on. Deactivate the likely plugin (or rename the plugins folder if you are locked out) and test; see how to find the plugin that broke your site. If a role was deleted by a plugin, restore it from a backup or recreate it with the plugin’s own tools.

Step 5: Check security and firewall rules

Security plugins, host firewalls and rules that restrict admin screens by IP can block access and show similar messages. Check their logs or settings, and ask your host whether a rule blocks the page. If you also see redirect problems on login, read WordPress login redirect loop.

Version and hosting differences

  • Multisite separates network administrators from site administrators, so you may need a super admin account.
  • Hosts that clone or stage sites sometimes use a different prefix on the copy.
  • Membership and shop plugins may add their own roles and rules.

How to verify the fix

  • The administrator account opens Settings, Users and Plugins.
  • Other users still have only the access they need.
  • You tested in a private window, and Site Health shows no new critical issue.

How to prevent it from happening again

  • Keep at least two trusted administrator accounts and know who holds them.
  • After a migration, test the administrator and other roles, not only the front end.
  • Back up before you change user roles or the database prefix; see is your WordPress backup really safe.

Frequently asked questions

Is this a hack?

Not by itself. It is a permission check. If you see it together with unknown admin users or changed files, investigate further.

Why did it start after a migration?

A changed table prefix can make WordPress unable to find your role records.

Can a plugin cause it?

Yes, especially plugins that manage roles or restrict access.

Is it safe to edit the database?

Only with a backup and care. A wrong edit can lock out more users, so ask for help if unsure.

What to do next

Check the account, the role and the prefix, then plugins and security rules. If you are locked out of your own site, wpallsolution offers an emergency WordPress fix and WordPress maintenance packages. We cannot promise a result without seeing your setup.

Sources and official documentation

Keep reading

More guides

Need a hand with this?

Tell us what is happening. We reply with honest next steps.

Talk to us