How can add a textfield to user/register page form in drupal 7? I want modify and adding a textfield in my Drupal 7 user/register page. I know that the form is generated by the function user_register_form()

Can i add a textfield in this way?

function bartik_copy_user_login($form, &amp;$form_state) {
  global $user;

  // If we are already logged on, go to the user page instead.
  if ($user-&gt;uid) {
    drupal_goto('user/' . $user-&gt;uid);
  }

  // Display login form:
  $form['name'] = array('#type' =&gt; 'textfield',
    '#title' =&gt; t('Username'),
    '#size' =&gt; 60,
    '#maxlength' =&gt; USERNAME_MAX_LENGTH,
    '#required' =&gt; TRUE,
  );

  $form['name']['#description'] = t('Enter your @s username.', array('@s' =&gt; variable_get('site_name', 'Drupal')));
  $form['pass'] = array('#type' =&gt; 'password',
    '#title' =&gt; t('Password'),
    '#description' =&gt; t('Enter that accompanies your username.'),
    '#required' =&gt; TRUE,
  );
$form['address'] = array('#type' =&gt; 'textfield',
    '#title' =&gt; t('Your address'),
    '#size' =&gt; 60,
    '#maxlength' =&gt; 125,
    '#required' =&gt; TRUE,
  );

  $form['#validate'] = user_login_default_validators();
  $form['actions'] = array('#type' =&gt; 'actions');
  $form['actions']['submit'] = array('#type' =&gt; 'submit', '#value' =&gt; t('Log in'));

  return $form;
}
Drupal 7 provides the ability to add custom fields to the User through admin/config/people/accounts/fields.  This functionality should already be in core.