Title: extra wp_user at installation
Last modified: August 18, 2016

---

# extra wp_user at installation

 *  [dcole07](https://wordpress.org/support/users/dcole07/)
 * (@dcole07)
 * [19 years, 1 month ago](https://wordpress.org/support/topic/extra-wp_user-at-installation/)
 * How can I have the install process of WordPress add an extra field to wp_user?(
   I have not installed WordPress yet and don’t want to use MyAdmin to add a field
   to MySQL)
 * What file creates the MySQL fields.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [whooami](https://wordpress.org/support/users/whooami/)
 * (@whooami)
 * [19 years, 1 month ago](https://wordpress.org/support/topic/extra-wp_user-at-installation/#post-547918)
 * take a look at wp-includes/upgrade-functions.php
 *  Thread Starter [dcole07](https://wordpress.org/support/users/dcole07/)
 * (@dcole07)
 * [19 years, 1 month ago](https://wordpress.org/support/topic/extra-wp_user-at-installation/#post-547931)
 *     ```
       // Create default user.  If the user already exists, the user tables are
       	// being shared among blogs.  Just set the role in that case.
       	$user_id = username_exists($user_name);
       	if ( !$user_id ) {
       		$random_password = substr(md5(uniqid(microtime())), 0, 6);
       		$user_id = wp_create_user($user_name, $random_password, $user_email);
       	} else {
       		$random_password = __('User already exists.  Password inherited.');
       	}
   
       	$user = new WP_User($user_id);
       	$user->set_role('administrator');
   
       	wp_install_defaults($user_id);
   
       	$wp_rewrite->flush_rules();
   
       	wp_new_blog_notification($blog_title, $guessurl, $user_id, $random_password);
   
       	wp_cache_flush();
   
       	return array('url' => $guessurl, 'user_id' => $user_id, 'password' => $random_password);
       }
       endif;
       ```
   
 * Was it wp-admin/upgrade-function.php, if so. Here I can see that we are creating
   the first user…
    So the fields are setup with the first account? Should I just
   add to return array at the bottom of this part I cut out? be like , ‘counter’
   => ‘0’;
 *  [whooami](https://wordpress.org/support/users/whooami/)
 * (@whooami)
 * [19 years, 1 month ago](https://wordpress.org/support/topic/extra-wp_user-at-installation/#post-547932)
 * yes it was wp-admin/ …
 *  Thread Starter [dcole07](https://wordpress.org/support/users/dcole07/)
 * (@dcole07)
 * [19 years, 1 month ago](https://wordpress.org/support/topic/extra-wp_user-at-installation/#post-548024)
 * would adding ‘counter’ => ‘0’; to the return array add another field?

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘extra wp_user at installation’ is closed to new replies.

## Tags

 * [add](https://wordpress.org/support/topic-tag/add/)
 * [extra](https://wordpress.org/support/topic-tag/extra/)
 * [field](https://wordpress.org/support/topic-tag/field/)
 * [MySQL](https://wordpress.org/support/topic-tag/mysql/)
 * [wp_user](https://wordpress.org/support/topic-tag/wp_user/)

 * 4 replies
 * 2 participants
 * Last reply from: [dcole07](https://wordpress.org/support/users/dcole07/)
 * Last activity: [19 years, 1 month ago](https://wordpress.org/support/topic/extra-wp_user-at-installation/#post-548024)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
