Remove  tag after form tag in user register form Drupal 7 I have added this code to template.php

function mytheme_theme(&amp;$existing, $type, $theme, $path){
  $hooks = array();
   // Make user-register.tpl.php available
  $hooks['user_register_form'] = array (
     'render element' =&gt; 'form',
     'path' =&gt; drupal_get_path('theme','mytheme'),
     'template' =&gt; 'user-register',
     'preprocess functions' =&gt; array('mytheme_preprocess_user_register_form'),
  );
  return $hooks;
}

function mytheme_preprocess_user_register_form(&amp;$vars) {
  $args = func_get_args();
  array_shift($args);
  $form_state['build_info']['args'] = $args;
  $vars['form'] = drupal_build_form('user_register_form', $form_state['build_info']    ['args']);
}


also I have created user-register.tpl.php with this

&lt;span&gt;test&lt;/span&gt;


but the result is

&lt;form class="user-info-from-cookie" enctype="multipart/form-data" action="/user/register" method="post" id="user-register-form" accept-charset="UTF-8"&gt;
  &lt;div&gt;
    &lt;span&gt;test&lt;/span&gt;
  &lt;/div&gt;
&lt;/form&gt;


How I can remove the div tags between form and span.

Thanks
That &lt;div&gt; is actually there to ensure XHTML compliance so it shouldn't really be removed.

If that's not an issue for whatever reason, you need to override theme_form(), which is responsible for adding that &lt;div&gt;, and just remove it from the returned markup. The full code is quite short so I'll include it:

function MYTHEME_form($variables) {
  $element = $variables['element'];
  if (isset($element['#action'])) {
    $element['#attributes']['action'] = drupal_strip_dangerous_protocols($element['#action']);
  }
  element_set_attributes($element, array('method', 'id'));
  if (empty($element['#attributes']['accept-charset'])) {
    $element['#attributes']['accept-charset'] = "UTF-8";
  }
  return '&lt;form' . drupal_attributes($element['#attributes']) . '&gt;' . $element['#children'] . '&lt;/form&gt;';
}