Skip to content

Instantly share code, notes, and snippets.

@fasterwp
Forked from azizur/create-wp-admin-account.sql
Last active August 16, 2021 20:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fasterwp/967ee3d6515b9f37aeb88fcf268a183c to your computer and use it in GitHub Desktop.
Save fasterwp/967ee3d6515b9f37aeb88fcf268a183c to your computer and use it in GitHub Desktop.
Create a WordPress Administrator user account using SQL
SET @username = 'simplenet';
SET @password = MD5('password');
SET @fullname = 'Simplenet Suport';
SET @email = 'noreply@simplenet.ro';
SET @url = 'https://simplenet.ro/';
INSERT INTO `wp_users` (`user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_status`, `display_name`) VALUES (@username, @password, @fullname, @email, @url, NOW(), '0', @fullname);
SET @userid = LAST_INSERT_ID();
INSERT INTO `wp_usermeta` (`user_id`, `meta_key`, `meta_value`) VALUES (@userid, 'wp_capabilities', 'a:1:{s:13:"administrator";b:1;}');
INSERT INTO `wp_usermeta` (`user_id`, `meta_key`, `meta_value`) VALUES (@userid, 'wp_user_level', '10');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment