Knowledgebase

How to disable user registration and remove the user login block in Drupal

By default, visitors to your Drupal site can register and become authenticated/registered users. If you don't want people to be able to register, you can remove the user registration functionality from the frontend of your site. You can do this by changing one setting in the administration panel of your Drupal application. After you log in, click on the Configuration tab in the top navigation bar. On the page that opens, under the People section click on the Account settings link. On the next page you'll see that under Registration and Cancellation the setting that allows visitors to register (with admin approval) is enabled. Mark the button for Administrators only and click on the Save configuration button at the bottom of the page.

This will remove the Create new account link from the user login block on the frontend of your site, and it will also remove the Create new account tab from the user account page (e.g. yourdomain.com/user). Now only users that are already registered will be able to log in, and only administrators will be able to create new accounts. Of course, as an administrator you need to be able to register, so that you can manage your site.

If you want to, you can remove the user login panel from the frontend of your Drupal site. You can do this also from the admin panel of your Drupal. Click on the Structure tab in the navigation bar and then on the page that opens click on Blocks. On the next page you'll see a table with the enabled and disabled blocks. The enabled ones have a drop-down menu which shows in which region on the frontend they are displayed. Find the User login block and from its drop-down menu select None. Then click on the Save blocks button at the bottom of the page. This will disable the user login block and it won't be displayed on the frontend. You will still be able to log in by using the URL address for the user account page. If, for example, your Drupal is installed directly in the public_html directory on your Drupal hosting account, the URL would be yourdomain.com/user.

Was this answer helpful?

 Print this Article

Also Read