How to: Disable new user registration in Drupal

How to: Disable new user registration in DrupalAfter a quick search I didn`t find how to simply switch off new user registration in Drupal. But it has even better feature – access roles. You can specify what usernames/emails/hostnames can access the members area or even register as user.
To disable new user registration, you have to add access rules for existing users. Go to yoursite.com/admin/user/rules/ and add a new rule. For example, first add an allow rule for user “admin“. Then for other existing users. After you have finished, add a deny rule and write “%” in the username field. This will allow to login only the allowed usernames and deny everything else. If the username is not defined it cannot be also registered.
You can even make private site and say to your friends add e.g. “-foo” to their usernames. So you make an allow rule with “%-foo” in username field.
The reason I need to block new user registration is spam. New users register everyday with random spam usernames.

Author: Valters Bože

abstract person

3 thoughts on “How to: Disable new user registration in Drupal”

  1. You can find those options under /admin/user/settings .
    There you have the following options:
    – Only site administrators can create new user accounts.
    – Visitors can create accounts and no administrator approval is required.
    – Visitors can create accounts but administrator approval is required.

Leave a Reply

Your email address will not be published. Required fields are marked *