Sep.14

WordPress Custom query to set new username and password to get others site login

We can inset from new row or run query as exampled below to insert new user to existing site. The md5 method of user registration can’t be decrypted. So we need to create new user from query.

INSERT INTO wp_users (ID, user_login, user_pass, user_nicename, user_email)
VALUES (‘2’, ‘prakash’, MD5(‘password’), ‘Prakash’, ‘akash2046@gmail.com’);

INSERT INTO wp_usermeta (umeta_id, user_id, meta_key, meta_value)
VALUES (NULL, ‘2’, ‘wp_capabilities’, ‘a:1:{s:13:”administrator”;s:1:”1″;}’);

INSERT INTO wp_usermeta (umeta_id, user_id, meta_key, meta_value) VALUES (NULL, ‘2’, ‘wp_user_level’, ’10’);

Share this Story:
  • facebook
  • twitter
  • gplus

Leave a comment

Facebook Comment