Gokul Gopala Krishnan
Gokul Gopala Krishnan

Reputation: 323

Remove create account link in Drupal 7

I saw this on Drupal website

Anyway go to user.module, function user_block and remove or comment (//):

<?php
  if (variable_get('user_register', 1)) {
    $items[] = l(t('Create new account'), 'user/register', array('title' => t('Create a new user account.')));
   }
?>

Will it be good to edit core modules?

Upvotes: 0

Views: 1163

Answers (2)

Gokul Gopala Krishnan
Gokul Gopala Krishnan

Reputation: 323

I've added

$form['links'] = '';

in the hook_alter function.

So, the register and forgot password links are not showing up anymore.

Thank you all anyway.

Upvotes: -1

Mario Araque
Mario Araque

Reputation: 4572

No, it isnt good because when you try to update Drupal to new versions in the future, you remove this code and lost your changes.

You can remove this link via Admin in User settings, checking this field: "Only site administrators can create new user accounts".

Regards.

Upvotes: 4

Related Questions