WordPress is a great Content Management System no doubt, but there are times you want to perform simple tasks and you realize that you are left with no option from your dashboard, or at least no plugin to easily achieve the task. Transferring multiple posts from one user to another in wordpress is one of such tasks, and here is how to easily go about it.
Before I continue with the tutorial, let me explain the situation I was in that required this, so you can understand what this would help you do.
I recently bought a wordpress site, created a new user on the site and wanted to transfer all the articles written by the previous blog’s owner to the new wordpress user. I couldn’t find an option on wordpress to transfer all the posts automatically to the new user, that meant I had to do it one after the other. I had to find a way to get things done faster, and that’s what this tutorial is about. Now you get the scenario, let’s move on.
Moving Multiple Posts From One User to Another In WP
1. You have to firstly log in to your WordPress Dashboard, then get the user ID of the two accounts you wish to use for this (that is, firstly, the account that has all the posts and the second account you wish to transfer the posts to). If you do not know how to find a user’s ID, read this post.
2. After you get the first and second account’s user IDs respectively, now you need to login to phpMyAdmin from cPanel and edit the database of your blog by clicking on it as shown. wp0048 is the database I’m using in this tutorial
3. When the selected database loads up, click on SQL from the menu navigation displayed as shown below.
4. Now a box would be displayed where you should input the MySQL code that performs the super magic. Here is the code you need.
UPDATE wp_posts SET post_author = NEW-USER-ID WHERE post_author = OLD-USER-ID
Here’s how the code works. Replace the wp_ with your database prefix (i.e if you make use of any), replaceĀ NEW-USER-ID with the USER-ID of the newly created wordpress account you wish to transfer the post to. And finally replaceĀ OLD-USER-ID the with the older accounts USER-ID having all the post.
In my case, as shown from the database above, I’ll have to replace wp_ with wp_vipl as you can see from my database table. Also, my new wordpress user has a user-ID of “2” while the one having the posts has a user-ID of “1”. So, here is what my code would look like.
UPDATE wp_vipl_posts SET post_author = 2 WHERE post_author = 1
Copy the code and paste into the SQL box as shown below, then Hit the Go button.
5. If you get a screen similar to this, then you are good to go.
You can now login to your wordpress dashboard once more. If you check on your posts, you’ll notice that all posts by the former author would be attributed to the new author you created with the new ID.
That’s how simple it is. Feel free to reach me using the comment box if you encounter any difficulties using this.
5 Comments
Oh,this is an handy tutorial,i will save this page for future reference. Thanks for this.
I’m glad you love this tutorial. Thanks for dropping by.
Nice posted
Thank you very much!!!
First I tried with this code “UPDATE wp_vipl_posts SET post_author = 2 WHERE post_author = 1” it dint work but this code “UPDATE wp_posts SET post_author = NEW-USER-ID WHERE post_author = OLD-USER-ID” worked for me.
Thank you