function hook_user_delete


Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/
cis7 user.api.php hook_user_delete($account)
cle7 user.api.php hook_user_delete($account)
elmsmedia7 user.api.php hook_user_delete($account)
icor7 user.api.php hook_user_delete($account)
meedjum_blog7 user.api.php hook_user_delete($account)
mooc7 user.api.php hook_user_delete($account)

Respond to user deletion.

This hook is invoked from user_delete_multiple() before field_attach_delete() is called and before users are actually removed from the database.

Modules should additionally implement hook_user_cancel() to process stored user data for other account cancellation methods.


$account: The account that is being deleted.

See also


Related topics

11 functions implement hook_user_delete()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

comment_user_delete in modules/comment/comment.module
Implements hook_user_delete().
entity_crud_hook_test_user_delete in modules/simpletest/tests/entity_crud_hook_test.module
Implements hook_user_delete().
lti_tool_provider_memberships_user_delete in sites/all/modules/ulmus/lti_tool_provider/lti_tool_provider_memberships/lti_tool_provider_memberships.module
Implements hook_user_delete().
lti_tool_provider_outcomes_user_delete in sites/all/modules/ulmus/lti_tool_provider/lti_tool_provider_outcomes/lti_tool_provider_outcomes.module
Implements hook_user_delete().
masquerade_user_delete in sites/all/modules/ulmus/masquerade/masquerade.module
Implements hook_user_delete().

... See full list

5 invocations of hook_user_delete()
EntityAPIController::delete in sites/all/modules/ulmus/entity/includes/
Implements EntityAPIControllerInterface.
field_attach_delete in modules/field/
Delete field data for an existing entity. This deletes all revisions of field data for the entity.
field_purge_data in modules/field/
Purges the field data for a single field on a single pseudo-entity.
node_delete_multiple in modules/node/node.module
Deletes multiple nodes.
user_delete_multiple in modules/user/user.module
Delete multiple user accounts.


modules/user/user.api.php, line 47
Hooks provided by the User module.


function hook_user_delete($account) {
  db_delete('mytable')->condition('uid', $account->uid)->execute();



Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/ in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/
The website encountered an unexpected error. Please try again later.