Im just noticed that when I try to delete an user does remove the user, but not their comments. Also choosing the option to change the deleted user's post author to admin does not work either. Is there an action that I could use to just write my own code to make these work?
WordPress should give this option below
Attribute all posts to:
Anyhow, I wrote a post on this (Clean Comments Table After User Deleted)
Also, you can move your all posts from deleted users to admin user.
global $wpdb; $admin_id = 1; // Assign admin user id here $posts_table = $wpdb->prefix . 'posts'; $users_table = $wpdb->prefix . 'users'; $strQuery = "UPDATE `$posts_table` SET post_author = $admin_id WHERE post_author NOT IN (SELECT ID FROM $users_table)"; echo $strQuery; $wpdb->query($strQuery);