WordPress.org

Forums

Admin Login (5 posts)

  1. stranger26
    Member
    Posted 1 year ago #

    Is there a way to check if the user is an admin via database or without logging into dashboard.
    Also, is there anyway to promote a user into admin from database?
    Thank you!

  2. Sarathlal N
    Member
    Posted 1 year ago #

    Hi;
    That is possible.

    You just want to edit wp-usermeta table.

    For administrator, the wp-capabilities meta-key will be a:1:{s:13:"administrator";b:1;} and wp_user_level meta-key will be 10 in wp-usermeta table.

  3. stranger26
    Member
    Posted 1 year ago #

    Hi, thank you for responding.
    However just to be safe, here is my current value in wp-capabilities:
    a:15:{s:13:"administrator";s:1:"1";s:8:"customer";s:1:"1";s:15:"membershipadmin";b:1;s:24:"membershipadmindashboard";b:1;s:22:"membershipadminmembers";b:1;s:21:"membershipadminlevels";b:1;s:28:"membershipadminsubscriptions";b:1;s:22:"membershipadmincoupons";b:1;s:24:"membershipadminpurchases";b:1;s:29:"membershipadmincommunications";b:1;s:21:"membershipadmingroups";b:1;s:20:"membershipadminpings";b:1;s:23:"membershipadmingateways";b:1;s:22:"membershipadminoptions";b:1;s:32:"membershipadminupdatepermissions";b:1;}
    Does it mean that the rest of the chunk is for plugins?
    Or do I just replace the whole chunk?
    Thank you! :)

  4. Sarathlal N
    Member
    Posted 1 year ago #

    Hi;
    in my fresh wordpress installation, for administrator, my the wp-capabilities meta-key will be a:1:{s:13:"administrator";b:1;}.

    But in your case, you have a membership plugin.

    Just backup your database first because if we got some error, we can replace them. So keep a good backup and try copy paste meta-keys on a new installation on your localhost with your plugins.

    I believe that you want to replace the whole value in wp-capabilities & wp_user_level. But I'm not sure about it because you have a membership plugin.

  5. S M Hasibul Islam
    Member
    Posted 1 year ago #

    Sure, why not?

    From Database option =>
    Please
    1. go phpmyadmin using by your DB access information.
    2. Select wp_usermeta table
    3. Edit from edit option
    4. Use this value a:1:{s:13:"administrator";b:1;} for become administrator user on meta_value

    From WP Dashboard option =>

    1. Go to wp-admin using by as a administrator user
    2. Select All User from Users menu.
    3. Press Edit button & select Administrator as Role.

    Done! May it will help you & work nicely.

    [ Signature moderated ]

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags