wp-admin access problems after database table change

So I’ve moved a WordPress site from one hosting provider to the next, and I didn’t like the naming of the database tables.  So I renamed the tables to something more preferred but then I received the below error message after successfully logging into the admin area.

You do not have sufficient permissions to access this page error

The website itself works perfectly right, it’s just the admin section.  Now the whole reason for me posting this is there is heaps and heaps of information about how to solve this problem but because WordPress is written for anybody to easily use, the answer was hidden by lots of people saying the same thing, that and, mentioning database upgrades that had gone wrong.  But in this case that wasn’t the problem.

The resolution, there are some table fields that make reference to the table names some how so when changing the database tables you need to change the below entries too.

You will need to use phpMyAdmin, it’s normally installed with cpanel, but if its not its really easy to install, just make sure you secure it as many people attempt to hack it.  Hopefully with out getting to technical, we will imagine our orginal tables had a prefix of wp_ and we’ve change them to wp_blog.  Add your names as such below.

table , wp_options which would now be wp_blogoptions
– option_name , wp_user_roles change to wp_bloguser_roles
table , wp_user_meta which would now be wp_bloguser_meta
meta_key , wp_capabilities change to wp_blogcapabilities
meta_key , wp_user_level change to wp_bloguser_level
meta_key , wp_dashboard_quick_press_last_post_id change to wp_blogdashboard_quick_press_last_post_id
meta_key , wp_user-settings change to wp_bloguser-settings
meta_key , wp_user-settings-time change to wp_bloguser-settings-time

Now you’ll need to make these usermeta changes for every user on your site, hopefully you don’t have too many.

I hope this is a help as it too me a couple of night to fully understand what was going on.  Happy blogging 🙂

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.