So yeah, I’m a genius. I managed delete all my admin capabilities (thank you very much Membership plugin). I could restore them, …if I had admin access, lol.
Anywhoo, how can I give all my capabilities back to admin? I have access to the database via PHPMyAdmin but have no idea where or what to add back to the DB.
Any help would be appreciated. Thanks!
The string below actually represents an array in serialized form.
Here:
a:1 means an array with a single element
s:13 means string and the length of the string followed by
Once that is in the table, you can use the unserialize() function to return it to an array for use in your code.
Many thanks.
It’s the wp_capabilities in the usermeta table. Mine says:
Ok, sorry for asking. I figured it out. But for future people, here’s a suggestion.
Step 1 (BACKUP!!!!) – backup your database, if the next step screws you over and you don’t have a backup it’s your own fault.
Step 2 – Use PHPMyAdmin or similar tool to access your DB, find the wp_usermeta table and then sort by user_id. User #1 is your admin. Next find your wp_capabilities field and click edit (this is the part that got screwed up).
I replaced what I had that was screwed up. This:
with this (which I copied from another WP database):
Before I check my own answer, can anyone confirm my answer, or explain the contents of this field and how it should properly be listed? You may take my answer and rewrite it as your own, and if it’s proper I’ll check your answer.
This is pretty simple. All I did was open phpmyaddmin, I selected a database from my former website I created, searched for
wp_usermeta
, clicked onuser_capabilities
, and since admin id is 1, all I did was copy the stringsand pasted it in my problematic db. Clicked save, log out the log back in and I got my roles back
I had the same problem and all these solutions didn’t help me.
The one which eventually worked for, was:
Update and now you have permission to everything in the membership plugin.
I made the database changes as instructed but when I signed in as an administrator I still could’nt alter users or pages.
When comparing the database field for user roles I noticed it was different from other WordPress installations. My solution was this:
Find the field named “wp_user_roles” in the table named [database prefix]_options, e.g. “wp_options”, and make sure it has all capabilities for administrators. It’s a serialized string with a lot of information so I think the easiest thing to do is to copy the data from a clean WordPress install.