• PLEASE HELP! I`m accidentally deleted Administrator Capability, how can I restore it? I can’t even access the site now ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • Same here!

    I’ve tried hours of research and tests and even changing small records in the database but I can’t recover that lost admin role.

    I’m now locked out of certain plugins or settings.

    Please help!

    Hi xicare, I’ve actually found out from the help of the really cool guys at Event Espresso [link redacted] that you can easily recover your admin role by creating a new one, naming it “Administrator” and the slug “administrator”, checking all boxes and creating a new “capability” named “administrator”. Then create another admin, login, navigate to your main admin account, give it the new admin role, logout, come back to your main admin, verify that you have access to all sections of the backend of your website then delete the test admin user.

    Let me know if it works!

    Plugin Author Vladimir Garagulya

    (@shinephp)

    This post may help.

    Hello,
    I encountered a variant of this problem.

    After using the rest button, I lost the main admin role.

    This is not what I understood from ‘reset’: the admin role is the first role that was created by the WordPress core, not by any other new plugin.

    Now I can not even see ‘users’ in my dashboard, nor can I access user role editor.

    Could you please advise me on the best next step?

    Thanks

    Arnold

    Plugin Author Vladimir Garagulya

    (@shinephp)

    Hi Arnold,

    It’s possible in case of some technical issue only.
    Read this article. Then check via myPhpAdmin or other SQL tool what roles are available, restore roles from the backup record created by URE or use data from the new fresh installed copy of WordPress.

    In order you need to assign to the user ‘administrator’ role manually these SQL commands will help:

    
    select * from wp_usermeta where user_id=1 and (meta_key='wp_capabilities' or meta_key='wp_user_level');
    

    to check current permissions of user with ID=1 (replace with your own value if needed).

    
    update wp_usermeta set meta_value='a:1:{s:13:"administrator";b:1;}' where user_id=2 and meta_key='wp_capabilities';
    
    
    update wp_usermeta set meta_value=10 where user_id=2 and meta_key='wp_capabilities';
    

    to change a role for this user to the ‘administrator’.

    In case your WordPress database prefix differs from the default ‘wp_’ replace ‘wp_’ with your own db prefix at all occurrences.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Deleted administrator Capability’ is closed to new replies.