Is there any Hook available for user delete in Drupal8. I have some custom data in a custom table and I want to delete those data while I delete any user in Drupal8. Can anybody help me out of this?

1 Answer 1


Use hook_entity_delete().


function mymodule_entity_delete(Drupal\Core\Entity\EntityInterface $entity) {
  if ($entity->getEntityType() == 'user') {

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.