A common problem when you’re moving a blog from one place to another, especially relevant after you’ve used WordPress’ handy built in Import/Export tools to migrate content, is the common error:

You do not have sufficient permissions to access this page.

This can be extremely frustrating, especially when you’re seeing this error where the user login page once was.  You’re effectively locked out.

What’s the Problem?

The problem here appears to be with the database and the reassignment of user roles.  For some reason, when you migrate the user data from one site to another, it sometimes doesn’t retain the user roles correctly.

If The Problem Affects Admin Accounts

Using PhpMyAdmin (or a comparable MySQL management tool), first backup your database.  Then findyour wp_usermeta table and locate the meta_key called “wp_capabilities” for your user_id.    Change the meta-value for this record to:

a:1:{s:13:"administrator";s:1:"1";}

If The Problem Affects Subscriber Accounts

Assuming you have an admin login (and there will always usually be one account that works 100% – the admin account you used when you performed the Import/Export process, all you need to do is to visit the user’s profile via the Dashboard, ensure the data is all correct and an email address is entered, add a new password and Update the information.

The problem with this however is that even if you do this, if there is JUST ONE user in the database with their roles incorrect the error message for permissions will still show.  All user accounts have to be correct.

All you can do at this point is either go through them one by one, or write a little script to check/fix the data for you.