I have encountered a weird problem in a Drupal site. Whenever I try to ban an abusive user, by going to the user's profile, change his status from active to blocked, and click save, the change does not take effect. Instead I just get a server time out message. There are a couple of thousands of users so disability to ban abusive ones is quite a hassle. Any suggestion to solve this?

  • Can you post an example of the error message?
    – Matt V.
    Commented Apr 14, 2011 at 21:06
  • 504 Gateway Time-out
    – alfish
    Commented Apr 16, 2011 at 6:58

2 Answers 2


Do it in the actual database, not via Drupal but via CLI, PHPMyAdmin, or whatever you have.

  1. Find out the user's ID.
  2. Go in to the raw database, i.e. not via Drupal but via CLI, PHPMyAdmin.
  3. Go the user table.
  4. Find their ID.
  5. Set the status field for that user to 0 (which means blocked).

The raw SQL would be something like (I haven't tested this):

UPDATE users SET status = 0  WHERE id = [user's id]
  • Thanks, I'm comfortable with CLI, but I was hoping to find a way to somehow debug Drupal itself.It should be easily done through Drupal interface. Actually it very tedious to open a terminal, log in to mysql, and execute the command each time that you want to block a bad user, specially when there are dozens of them every day :)
    – alfish
    Commented Apr 15, 2011 at 9:12
  • It sounds like your Drupal installation is running out of memory, so you could up the limit in your php.ini file.
    – Dan Blows
    Commented Apr 15, 2011 at 11:08
  • Well, I doubled the memory_limit to 256M and also max_execution_time to 60 seconds and restarted both fpm and nginx. But still got the same problem.
    – alfish
    Commented Apr 16, 2011 at 7:02
  • BTW, I just noticed that your command will set the user1= admin inactive !
    – alfish
    Commented Apr 16, 2011 at 7:35
  • Oh yes! I meant to put a caveat of 'where ID is the user's ID'. Fixing it now...
    – Dan Blows
    Commented Apr 16, 2011 at 9:33

To block certain users in drupal6 go to the user management->access rules this will take to you www.yoursitename/admin/user/rules/list . In this click "Add Rule" tab and select "Deny" under access type and "Username" under Rule type (as you want to block the user) and enter the user name in the text field under the "Mask" and click "Add rule".

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.