WordPress: You do not have sufficient permissions to access this page

Try a search on Google for this post’s title and you’ll find dozens and dozens of pages referring to this error. Some of them help you fixing it, some of them just link to other pages but none of them makes it really easy for you to resolve this issue fast.

Every time I move a WordPress site to another (sub-)domain, e.g. from blog.example.com to www.example.com, using blog_ and www_ as the database table prefix respectively I come across this neat error – it’s this prefix that’s causing trouble.

Basically, this prefix gets hard coded into the database during WordPress’s initial setup. Sure, there might be reasons to do this but even as a developer I must admit that this is a really annoying limitation from a pure user’s perspective.

Solution

The solution is pretty straight forward: just replace occurrences using the old table prefix in your database with the new one. You’ll find them here:

  1. prefix_usermeta
    • prefix_user_level
    • prefix_capabilities
    • prefix_autosave_draft_ids
  2. prefix_options
    • prefix_user_roles

You’ll have to make sure that prefix is the same.

Fixing it fast

You’ll want to get this done fast? Just enter your old and new prefix into the boxes below, copy the SQL snippet and apply it to your database. Done.

Old prefix:

New prefix:

0 comments ↓

There are no comments yet.

Leave a Comment