Support » Fixing WordPress » Deleted user’s posts

  • What happens to a user’s posts when they are deleted?

    I am clear about what happens if I reduce a user’s level (and reducing to zero is almost as good as deleting) but I could not find anything on what happens if a user a deleted altogether (which is possible?).

Viewing 2 replies - 1 through 2 (of 2 total)
  • Deleted posts are just that; deleted from the database. If you mistakenly delete a post, the only way to get it back is to A. pull it from a back up of the database, B. dig it out of the Google cache or a browser’s disk cache , or C. you had it memorized.

    Yes, a user can be deleted, and for the purpose of retaining posts, shorting them to level 0 is the best alternative to removing them. Of course, if in the end you really do need to delete an account, you can reassign their posts to another user (I know of someone who uses a *dummy* login for that). There’s a quick SQL command way of doing that:

    UPDATE wp_posts SET post_author = '1' WHERE post_author = '10';

    The first post_author value should equal the user ID of the author you’re moving posts to, and the second is their current author. The posts table prefix would need to be changed if other than the default (wp_) is used.

    Thanks, I phrased the question badly (what I should have said “if I delete a user, what happens to that user’s posts). In spite of that your answer tells me what I need.

    Either of your suggestions would do what I want, so I suppose I should go for reducing the user level and avoid unnecessary mucking about with the database.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Deleted user’s posts’ is closed to new replies.