Is there any Drupal module which checks the username in the database, if its present then it should display some suggestions to be selected just like the yahoo or gmail gives on registration?

2 Answers 2


There is no module that does that. The closest you will find is the one that just checks if the username is available while registering. An example of such module is username check. To achieve the username suggestion bit, you may have to write a custom module for that.

This very simple module allows visitors to check username originality quickly using AJAX request during registration (completing registration form). This makes registration process more convenient as you don't need to submit your registration form to find out whether this username is already taken or not. This module is sensible to standard Drupal username validation as well as Access Rules validation.

or friendly register

Friendly Register module allows users to see if a username or email address has already been used during registration before they submit the form. This module checks the database and returns an error if the username is already in use. In addition to checking the username the module checks if there is already an account using that email address, if there is, a message is displayed with links to the login or reset password pages.

  • Any Idea how will I do that in custom module?
    – Ahmad
    Jun 28, 2013 at 10:47
  • Well you would have to implement the hook_form_alter() to alter the user_register_form, with javascript check the username is available (e.g. ben). If it is not available, write a function that appends some certain kind of words (like 1001) to the currently tested username (e.g ben) and it becomes (ben1001) check if is available again in the database again and create about four different suggestions. present it to the user with a radio button saying choose one of this username and if he selects one, fill the username field with the selected username.
    – 4life
    Jun 28, 2013 at 11:07

If your searching a module that "checks the username in the database", I propose you to look at /modules/user. In 'user.module'.

  • Can you expand a little how the core user module does this?
    – mpdonadio
    Jun 28, 2013 at 11:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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