Last updated November 19, 2009. Created on December 1, 2004.
Edited by LeeHunter, Thomas_Zahreddin, AjK, Dublin Drupaller. Log in to edit this page.

In the default setup the Drupal login block is always displayed unless a user is logged in. This may not always be desirable. For example, if you are using Drupal to create a site that has a very small number of people actually logging into the system to create or edit content, then you probably don't want a large portion of your screen real-estate taken up with a login block that only serves a small minority of users. This also confuses the majority of your users that will not have the option to log in.

To disable the login block:

  1. In the Administration section, select Site building » blocks)
  2. In the Region column next to User login select None
  3. At the bottom of the page, click Save Blocks

Your regular content editors and administrators can still log in to the site by directly accessing the login page, http://www.example.com/?q=user. If you are using clean URLs, you may also use http://www.example.com/user, but remember that the ?q=user version will always work whether you have clean URLs enabled or not.

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.

Comments

nerdcore’s picture

In Drupal 7.x the location has changed from "Site building" to "Structure".

Administration » Structure » Blocks

fatkinson’s picture

I have Drupal 7 running on a testbed. The URL is in this format: IP address/~username/
I followed your instructions and deleted the user login from the site.
I logged out to see that it worked. It did.
I tried the IP address/~username/user . It didn't work. I got an error message from Apache (not from Drupal 7).
I tried the IP address/~username/q=user . It didn't work and I got the same result.
So now I am locked out of the site because I can't get to a login prompt to log in as administrator.
Any ideas?

fatkinson’s picture

Suddenly, it started working.
Weird.

Nyunt Win Aung’s picture

mhurston’s picture

Would love to know if there is a way to rename the /user or have it redirected to a different page like /speciallogin. I know there has to be a way to do this since I'm seen Drupal sites like swtor.com and they don't use the /user page.

massiws’s picture

@mhurston: sorry, but swtor.com/user redirect to login form.
I found a workaround with Login Disable module: the default login form at /user is locked and to login you must use /user/login?keyPhrase.

I'm still searching for a method to hide /user page...

LaTradia’s picture

I'm still searching for a method to hide /user page...

I also have been looking for a solution and made a simple rule (using Rules) where anonymous (and/or other roles) users are redirected to e.g. <front> if they visit the URL user/*:

{ "rules_url_disable_user" : {
    "LABEL" : "URL: Disable user path",
    "PLUGIN" : "reaction rule",
    "ACTIVE" : false,
    "OWNER" : "rules",
    "TAGS" : [ "redirect", "user", "user management" ],
    "REQUIRES" : [ "rules", "rules_i18n" ],
    "ON" : { "init" : [] },
    "IF" : [
      { "NOT user_has_role" : {
          "account" : [ "site:current-user" ],
          "roles" : { "value" : {
              "3" : "3",
              "4" : "4",
              "5" : "5",
              "6" : "6",
              "7" : "7",
              "11" : "11",
              "8" : "8",
              "9" : "9",
              "14" : "14",
              "12" : "12",
              "2" : "2",
              "10" : "10"
            }
          },
          "operation" : "OR"
        }
      },
      { "OR" : [
          { "data_is" : { "data" : [ "site:current-page:path" ], "value" : "user" } },
          { "data_is" : { "data" : [ "site:current-page:path" ], "value" : "user\/login" } },
          { "data_is" : { "data" : [ "site:current-page:path" ], "value" : "user\/register" } },
          { "data_is" : { "data" : [ "site:current-page:path" ], "value" : "user\/password" } }
        ]
      }
    ],
    "DO" : [
      { "redirect" : { "url" : [ "site:url" ] } },
      { "drupal_message" : {
          "message" : "Logging in and registering have been temporarily disabled. Please try again later.",
          "type" : "error",
          "repeat" : 0
        }
      }
    ]
  }
}

Very important! If you are going to use this rule and are the only user that can manage rules, remeber to disable it before you log out/clear browser cache etc.

Londos’s picture

"Just try to #start, and see magic will happen"

dirque’s picture

You can go to structure->blocks then click on configure next to User Login. There you can tell it to appear only on certain pages (Contact Us page?).

--
Dirk

mesaonka’s picture

Thanks a lot.