Delete User
Hello,
I have a question about the suppression of a user.
I have a user who created questions, I would have deleted this user, the questions and their answers are deleted.
How can I transfer all meta from one User to another (questions, reponses…), for example “Anonymous”.
Is it possible ? do you have a official plugin for this?
Thank you in advance,
Best regards.
LWM Sarah BELLEVEGUE (Buyer) Answered question
Hello,
There is not any plugin for that. But you can do it by simply running a post query loop. Here is an example for question post type.
$the_query = new WP_Query( array( 'post_type' => 'question', 'author' => 0, 'posts_per_page' => -1, ) ); while( $the_query->have_posts() ) { $the_query->the_post(); wp_update_post( array( 'ID' => get_the_ID(), 'post_author' => NEW_USER_ID_HERE, )); }
You can do same for answers. And use comment query for comments.
Rahul Aryan Answered question