How to delete all media files and related information while deleting a user


@joshuaabenazer : I want a hook to delete all the media related information and the media files of a particular user while deleting him.Thanks in advance.



@joshuaabenazer am looking for your reply


@stan-reeves-963 - I guess this should happen automatically when you delete a user and select “Delete all posts.” on the next step of deleting a user.

Please do take a backup of everything before trying this though. Once it is deleted there would be no way of getting it back.