How to remove the size of an input?
This question is quite old but here a solution

/**
 * Implements template_preprocess_form_element().
 */
function mytheme_preprocess_input(&amp;$variables) {
  // remove size
  unset($variables['element']['#size'], $variables['element']['#attributes']['size'], $variables['attributes']['size']);
}