Only users who paid can finish registration and they get a role applied to their user.

Problem is that, users can still register through default registration form.

Disabling registration for in Account settings will disable the registration globally everywhere?

How to disable it only in /user/register? But allow during commerce module checkout process?

1 Answer 1


You can do that with hook_menu_alter() by changing the access for that path:

function MYMODULE_menu_alter(&$items) {
  $items['user/register']['access callback'] = FALSE;
  • Worked. Except used inside theme's template.php, not separate module. Dec 13, 2017 at 19:27

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.