Skip to main content

How to Add a New WordPress Admin User via MySQL

In the wp_users table, click on the Insert tab.

Fill in the following details:

  • user_login: Insert the username you want to use for your new admin user.
  • user_pass: Add a password for the account and select MD5 in the Function drop-down.
  • user_email: Add the email address you want to use.
  • user_registered: Select the date and time for when this user should be registered.
  • user_status: Set this value to zero.

 go to the wp_usermeta table and click on Insert.

  • user_id: Fill in the ID of the user you created in the previous step.
  • meta_key: Enter wp_capabilities
  • meta_value: Fill in the field with a:1:{s:13:"administrator";s:1:"1";}

 

Comments

Popular posts from this blog

add custom post type

/**  *  * add custom post type  *  */ function my_custom_post_product() {   $labels = array(     'name'               => _x( 'Products', 'post type general name' ),     'singular_name'      => _x( 'Product', 'post type singular name' ),     'add_new'            => _x( 'Add New', 'book' ),     'add_new_item'       => __( 'Add New Product' ),     'edit_item'          => __( 'Edit Product' ),     'new_item'           => __( 'New Product' ),     'all_items'          => __( 'All Products' ),     'vi...

Toolset conditional

[wpv- if evaluate= "'[wpv-current-user info='id']' = '[wpv-post-author format='meta' meta='ID']' OR '[wpv-current-user info='role']' = 'administrator'" ]      //the content you want to hide goes here [/wpv- if ]