Database » Assign all posts from one user to another

Assign all posts from one user to another

This simple query allows you to transfer all posts from one user to another.

SQL query

This will assign all posts from author ID=14 to the user with ID=1 (admin).

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

WP-CLI

wp user delete [email protected] --reassign=1

This will remove the user [email protected] and assign all his posts to user with ID=1 (admin).

See also  Reset WordPress user password using WP-CLI

Was this post helpful?

Leave a Comment

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.

Recommended