Accessing Drupal’s Login Page After You Have Already Disabled The User Login Block

Drupal is big on user community. By default, a fresh installation of Drupal plops a user login block in the left navigation column. But maybe you’re just getting started with a new site and you don’t want to look pretentious talking about “users” when in fact you are the only one using the site.

Well, turning off the user login block is easy. As with any block, you can disable it via Administer->Site Building->Blocks. However, once you’ve disabled the block for the general public, you will still want to log in. Now what?

To get a login page, browse to the root of your Drupal installation and add “?q=user” to the end of the URL:

http://www.somesite.com/?q=user

or

http://www.somesite.com/install_directory/?q=user

P.S. Here’s to hoping that your site gets big enough that you want to turn the login box back on!!!

Share and Enjoy:
  • Digg
  • del.icio.us
  • Reddit
  • Slashdot
  • Technorati
  • DZone
  • NewsVine
  • StumbleUpon
  • E-mail this story to a friend!
  • Sphinn

36 Comments

  1. Cliff says:

    Thanks. You’re a lifesaver. I was really worried when I realized I changed all my pages from published to unpublished and found out the login page I had created was something I needed.

  2. jamiegrove says:

    That freaked me out too! Glad I could help, Cliff!

  3. Margaret says:

    I knew I’d read about this somewhere, but when I tried to look it up at drupal.org and then Google it, I had a heck of a time finding this info.

    May you get lots of traffic for writing this!

    Cheers!
    Margaret

  4. felix says:

    Thank you for this tip.

  5. elisa says:

    thank you very much!!!!!!

  6. jamiegrove says:

    Non c’è di che, Elisa! :)

  7. Chris says:

    This doesn’t seem to work if you have short URLs enabled. You’ll just get the generic “Page Not Found” error.

  8. jamiegrove says:

    Hi, Chris.

    If you have clean URLs enabled, you can use:

    http://www.somesite.com/user

  9. jenny says:

    Hi, I just got drupal installed, and it is not allowing me to login as administrator. So basically, I am locked out of my own site. When I request a new password it still does not work, and I get the Page Not Found error. Help!

  10. jamiegrove says:

    Hi, Jenny.

    If you have database access, you can reset the password manually. The link below has a good discussion of how to do it.

    http://drupal.org/node/32650

  11. jenny says:

    O, thank you soooooooooooooooooo much. Wow, I really appreciate it. :D

  12. jenny says:

    Hmmmm…it worked and then reverted. So I was able to edit and sign into my site as admin, and then when it kept requesting me to sign in again and again I went back to the database and the password was reset to the default. Everytime I try to change it again it just reverts back. Seems strange.

  13. jamiegrove says:

    @Jenny That does seem pretty odd. Once you log in, try changing the password through the Drupal admin itself before doing anything else. If you already tried that, perhaps there is a module interfering?

    I know the SMFforum module has caused problems for some people. From your first post, it sounds like this was a straight install but assuming it’s not maybe disabling more exotic modules might help.

    Sorry if that sounds like a bit of a dodge. Not really sure what might cause the password to revert like that, especially if you changed it in the database by hand. You might want to post the question on the Drupal forum.


    Also for those reading the thread, the SQL to update the password manually is:

    UPDATE users SET pass = MD5(’new password’) WHERE uid = 1;

    Obviously, you replace ‘new password’ with the password of your choice. :)

  14. Keith says:

    Thanks. You saved my butt because I was trying out views and block bars, and didn’t notice that the user block just dropped right out.

  15. Sebastian says:

    And if you modified your Drupal themes, you need to use print $content to see the login box …

  16. Stu Megan says:

    thanks! saved me lots of time ;) ..

  17. dipperwell says:

    Thanks for this easy fix, I was starting to get a little worried!

  18. Bob says:

    Thanks.

  19. shirley says:

    Thanks! I was going “uh-oh…”

  20. Christian says:

    Thanks :-)

  21. Phred says:

    Karma points for you!

  22. Mark says:

    Thanks!

  23. rai says:

    wow that works. many thanks

  24. Shane says:

    Thank you, I am in the process of learning drupal and was a little worried for awhile until I found this.

    Thanks again.

  25. Sunni says:

    Can someone help me? I can’t log in as administrator/user1 even though I have my admin name and my password. All has been working fine until about an hour ago, when my computer crashed. Working locally. Apache2Triad on a WinXP. Drupal6x. I’m using a theme I created. Admin though is using Garland. Clean urls being used.

    When I point browser to http://www.somesite.com/?q=user, my custom page comes up and username/log-in is in content area. But when I type in superadmin and my password, the only thing that happens is the username box becomes red, eg., the word “username” turns red and the outline of the box for the username turns red.

    I opened up phpmyadmin and went to users table. I am a total newbie in regard to phpmyadmin. I can now see the superadmin user screen. It says uid1 and then username superadmin. Then there’s password.

    Not sure what I’m looking for but it looks ok.

    What the heck is going on? Now what to do?

  26. Sunni says:

    In phpmyadmin, where do I type: UPDATE users SET pass = MD5(’new password’) WHERE uid = 1;

  27. MSS says:

    Thanks Jamie, you saved my day. I am a newbie with drupal and this one actual freaked me out!

  28. Allan says:

    Thanks I though I need to re install again. whew that was close

  29. Mandar says:

    Thanks a lot! I renamed the home page and logged out. And just could not get back to the login option. Was saved just because of your trick :)

  30. Jack09 says:

    I was just wondering one thing. What if I dont want to turn it off the login what if I just want to put a link so people click on that link and then in a new page the user login block comes in. Like there is in many drupal and not drupal sites like for example https://www.isc.org/. How can I do that? Need a module or how?

    Regards :) and thanks for the tip. I learn that when I update my drupal site and turn the site off for maintanance.

    Cheers!!

  31. Is there a similar link to logoff? I am logged in as a user and want to change the user but cant get the login form because i am already logged in?
    Grayns Web Design & Development’ s last blog ..Complete Web Design & Development Solutions My ComLuv Profile

  32. Phil Sexton says:

    Thank you sir! Works like a charm.

  33. elgwiedo says:

    hi Jamie

    Don’t know what happened to my site, but as admin I don’t see the “add new content” button – or whatever it is called.” Any idea how to bring it back ?
    thx

  34. Dennis says:

    Thanks a ton, saved me a lot of time, and stress!

  35. abel says:

    many thanks, i have only one login entry portal page and i reCaptcha it without the cert and i was stuck. You my friend can have a drink on me!

    Thanks
    Abel
    abel ‘ s last blog ..GTGweb makes over Tactical Earpiece with Drupal My ComLuv Profile