Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to remove password strength in Drupal registration form? enter image description here

share|improve this question

migrated from stackoverflow.com Jan 5 '13 at 20:28

This question came from our site for professional and enthusiast programmers.

up vote 2 down vote accepted

Use Password Strength Disabler Drupal Module.

Enabling this module will disable the password strength checker upon new user registration.

share|improve this answer
I found this module, but I think fix it without contib module :) – geph Jan 5 '13 at 10:49
Oh, I just copied 4 lines from this module to my module. Thanks. :) – geph Jan 5 '13 at 11:10

If you just want to disable it for the user registration form, without using third-party modules, you can use the following code in one of your custom modules.

function mymodule_form_user_register_form_alter(&$form, &$form_state) {
  $form['#attached']['js'][] = drupal_get_path('module', 'mymodule') . '/user.js';

The content of the user.js file would be the following.

Drupal.behaviors.password.attach = function (context, settings) {};

Differently from the approach followed by the Password Strength Disabler module, the code I suggest just removes the password strength part from the user registration form, not from every form using the password confirmation form element. The generic code to remove it in more than one form is the following one.

function mymodule_form_alter(&$form, &$form_state, $form_id) {
  if (in_array($form_id, $alter_forms)) {
    $form['#attached']['js'][] = drupal_get_path('module', 'mymodule') . '/user.js';

$alter_forms is an array containing all the form IDs for the forms where you don't want the password strength to be visible.

share|improve this answer

If you do not want to install any module at all, Just copy this function from the Disable password strength module into your theme's template.php file, it works great for me on my sites. "yourtheme" in the function should be changed to your theme name. That's all.

function yourtheme_element_info_alter(&$types) {
if (isset($types['password_confirm']['#process']) && (($position = array_search('user_form_process_password_confirm', $types['password_confirm']['#process'])) !== FALSE))

Note: Though this code came from the Disable password strength module, you do NOT need to install the module, just copy the above code provided into your theme's template.php file and thats it.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.