- January 24, 2017
- Posted by: thestateofart
- Category: Development
No Comments
All of the sudden my WordPress site wouldn’t allow me to access the wp-admin. Once I logged in, it would just redirect me to the homepage.
I tried disabling plugins, changing themes, and doing rain dances, all to no avail. It appeared that the problem was coming from the database. I cleared out all the transients in wp_options and a bunch of other junk but that didn’t help. I cleared out all 300,000 users in wp_users and that didn’t help. Suddenly it came to mind that there may be a problem with the wp_usermeta table that appears in phpmyadmin to be “in use”.
I had to drop wp_usermeta and create it again, then added the fields:
- unmeta_id – leave this blank (it will be auto-generated)
- user_id – this will be the id of the user you created in the previous step. Remember we picked 4.
- meta_key – this should be wp_capabilities
- meta_value – insert this:
a:1:{s:13:"administrator";s:1:"1";}
Insert another row with the following information:
- unmeta_id – leave this blank (it will be auto-generated)
- user_id – this will be the id of the user you created in the previous step. Remember we picked 4.
- meta_key – this should be wp_user_level
- meta_value – 10
Now it works.