Skip to Main Content

How to Create an Administrator on WordPress Using SQL

Divi: the easiest WordPress theme to use

Easily create your website with Elementor

Elementor allows you to easily create any website design with a professional look. Stop paying expensive for what you can do yourself. [Free]

A few days ago, one of our subscribers ran into a problem because his WordPress website was hacked and he could no longer access his dashboard. In this tutorial, we will present a method that allows you to create a WordPress administrator by MySQL on PHPMyAdmin.

But before, if you have never installed WordPress discover How to Install a WordPress Blog in 7 Steps et How to search, install and activate a WordPress theme on your blog 

Then back to why we are here.

Remark: Always make a backup of your database before making any MySQL modifications.

This tutorial requires some basic knowledge of how phpMyAdmin works.

Discover How to duplicate a WordPress database with phpMyAdmin

First, you need to login to phpMyAdmin and locate your WordPress database. You will find phpMyAdmin on your CPanel.

create a WordPress administrator - phpmyadmincpanel-1Once you're there, we'll make changes in the tables wp_users "And" wp_usermeta ". Click on " wp_users " to begin.

phpMyAdmin users wp

We need to insert the information of our new administrator, so click on the Insert tab like in the image below. In the insert form, add the following: 

Learn as well How to change WordPress theme from PhpMyAdmin

  • ID - choose a number (in our example, we will use the 4 number).
  • user_login - insert the username you want to use to access the WordPress dashboard.
  • User_Pass - add a password for this username. Be sure to select MD5 function in the function menu (refer to the image below).
  • user_nicename - put a nickname or whatever you want.
  • user_email - add the email you want to associate with this account.
  • user_url - this would be the URL of your website.
  • user_registered - select the date / time at which this user is registered.
  • user_status - set this parameter to 0.
  • display_name - put the name you want to display for this user on the website (the value can be the same as user_nicename).

create a WordPress administrator by MySQL - insert user phpmyadminClick on the button " perform »

Divi: The best WordPress theme of all time!

With over 901.000 downloads, Divi is the most popular WordPress theme in the world. It is complete, easy to use and comes with more than 62 free templates. [Recommended]

Then we'll have to add values ​​to wp_usermeta table. Click on the table of wp_usermeta then click on the Insert tab, as in the previous step. Then add the following information to the form:

How to create a multipage form on WordPress ? Discover it by consulting this article.

  • unmeta_id - leave this field empty (it will be generated automatically)
  • user_id - this will be the username of the user you created in the previous step. Remember we picked 4.
  • meta_key - it should be " wp_capabilities »
  • meta_value - insert this: a: 1: {s: 13: "administrator"; s: 1: "1";}

Insert another line with the following information:

  • unmeta_id - leave this field empty (it will be generated automatically)
  • user_id - this will be the username of the user you created in the previous step. Remember we picked 4.
  • meta_key - it should be " wp_user_level »
  • meta_value - " 10 »

Then click on the button perform And you will have created a new user yourself.

At this step, you should be able to log into your dashboard, with the username and password you specified for that user. 

See also our tutorial on How to optimize your WordPress Robots.txt file for a perfect SEO

Once logged in, click Users and change the username you just created. Go all the way down and click on the button " Record " (you don't have to change anything). This will allow WordPress to add a bit more information to your new account.

SQL request

For developers who want to speed up this process, you can simply drop this SQL query into your database, and adapt the values ​​of the database.

INSERT INTO `databasename`.`wp_users` (` ID`, `user_login`,` user_pass`, `user_nicename`,` user_email`, `user_url`,` user_registered`, `user_activation_key`,` user_status`, `display_name`) VALUES ('4', 'demo', MD5 ('demo'), 'Your Name', '[email protected]',' ',' 2011-06-07 00: 00: 00 ',' ',' 0 ',' Your Name '); INSERT INTO `databasename`.`wp_usermeta` (` umeta_id`, `user_id`,` meta_key`, `meta_value`) VALUES (NULL, '4', 'wp_capabilities',' a: 1: {s: 13:" administrator "; s: 1" 1 ";} '); INSERT INTO `databasename`.`wp_usermeta` (` umeta_id`, `user_id`,` meta_key`, `meta_value`) VALUES (NULL, '4', 'wp_user_level', '10');

Discover also some premium WordPress plugins  

You can use other WordPress plugins to give a modern look and optimize the grip of your blog or website.

We offer you here some premium WordPress plugins that will help you do that.

1. WPBakery Page Builder

WPBakery Page Builder, formerly known as Visual Composer, is another premium and extremely popular page builder. 

wp bakery page builder e1544277016913
Much of this popularity comes from the fact that Page Builder Pagers comes with almost 99% of ThemeForest WordPress themes. But the fact remains that it is used on a very large number of websites.

Are you looking for the best WordPress themes and plugins?

Download the best plugins and WordPress themes on Envato and easily create your website. Already more than 49.720.000 downloads. [EXCLUSIVE]

Like Divi Builder, WPBakery Page Builder allows you both a visual edition and an edit in the back-end. Compared to something like Elementor or Divi Builder, WPBakery Page Builder's style options are a bit limited. You have good control over the lines, but the style options for the individual items are a bit more limited.

If you want to use your own CSS, you can add a class or an identifier Custom CSS to individual elements, or you can add actual styles to the page level.

I'm not sure that WPBakery Page Builder has unique features that are particularly noteworthy. But what he has is a huge community of extensions.

Download | Demo | Web hosting

2. Super Side Menu

Side Menu is a great WordPress plugin that allows you to add stylish and stunning side menus to your website. It helps to showcase the content of the website and also improves the usability of each page. 

Side Menu

It is able to increase the usability of the website menu due to its compactness and informative character. Its set of parameters will allow you to configure its navigation with a very attractive design.

Its other features are: support for an unlimited number of buttons, the ability to place the menu to the right or left, easy insertion of links, control of font size and icons, control of borders , and much more. 

Download | Demo | Web hosting

3. Feedback Rating Pro

Feedback Rating Pro is an evaluation WordPress plugin that counts all the positive, neutral and negative comments of users between them and displays them in different styles in the user directory, the user profile page, the user feed activity of BuddyPress, the BuddyPress Membership Directory or wherever you need it.

Feedback Rating Pro

Unique algorithm to automatically block / unblock users saves you time. It is a handy tool for all types of community. The users will be able to evaluate each other very easily after a communication.

Download | Demo | Web hosting

Easily create your Online Store

Download free WooCommerce, the best e-commerce plugins to sell your physical and digital products on WordPress. [Recommended]

Other recommended resources

We also invite you to consult the resources below to go further in the grip and control of your website and blog.


Here ! That's it for this tutorial. I hope it has allowed you to create a new user on WordPress. Feel free to share the tip with your friends on your social networks.

However, you will also be able to consult our resources, if you need more elements to carry out your projects of creation of Internet sites, by consulting our guide on the WordPress blog creation.

But, in the meantime, tell us about your Comments and suggestions in the dedicated section.


This article features 0 comments

Leave a comment

Your email address will not be published. Required fields are marked with *

This site uses Akismet to reduce unwanted. Learn more about how your comments data is used.

Back To Top