How to Create a WordPress User Through An SQL Query From PhpMYAdmin Area With Admin Right

First published 8 January 2015

This article is from our archive. It is kept as it was first written, so some steps or versions may be out of date.

Are you looking to create a WordPress user using an SQL query from the PhpMyAdmin area? Here is the query that you need to execute with proper parameters.

You need to update a few things like ID (Don't use an existing id), Username, password in raw text, email and user name as profile info. You also need to check for a few thing while creating a WordPress user from database (The table prefix). Once you have


SET @id = 99;
SET @user = 'username';
SET @pass = 'password';
SET @email = '[email protected]';
SET @name = 'marshall';

INSERT INTO wp_users (ID, user_login, user_pass, user_nicename, user_email, user_url, user_registered, user_activation_key, user_status, display_name) VALUES (@id, @user, MD5(@pass), @name, @email, '', '2013-06-20 00:00:00', '', '0', @name);
INSERT INTO wp_usermeta (umeta_id, user_id, meta_key, meta_value) VALUES (NULL, @id, 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}');
INSERT INTO wp_usermeta (umeta_id, user_id, meta_key, meta_value) VALUES (NULL, @id, 'wp_user_level', '10');
INSERT INTO wp_usermeta (umeta_id, user_id, meta_key, meta_value) VALUES (NULL, @id, 'active', '1');