To achieve this recipe, we'll use phpmyadmin and the SQL language. As the following commands will modify your WordPress database, don't forget to create a backup before running any command throught phpmyadmin.
The first thing to do is getting the IDs of WordPress users. Once logged in phpmyadmin, insert the following SQL command:
SELECT ID, display_name FROM wp_users;
Right now, phpmyadmin displayed a list of WordPress users associated with their IDs. Let's say that NEW_AUTHOR_ID is the ID of the "new" author, and OLD_AUTHOR_ID is the old author ID.
UPDATE wp_posts SET post_author=NEW_AUTHOR_ID WHERE post_author=OLD_AUTHOR_ID;
That's all. Once this last command has been run, all posts from the old author now appears to have been written by the new author.
20 Responses
Thanks a lot for the recipe, was looking a for a solution, having the same problem.
That’s easier than I thought it would be
How about changing Page (not post) category automatically like changing poster name explained above? i.e. changing from “uncategorized” to “info”.
Thanks
Any idea of how to do this in a WPMU setting? I’ve consolidated a few blogs into a single WPMU install, but when I imported the posts, I imported them all as “admin”. Each blog has a different author, but all are “administered” by admin.
What sort of SQL magic would I use to select only admin’s posts from a certain blog? I suppose it would involve a WHERE clause indicating the BLOG_ID, but I wouldn’t know how to test it without killing everything in the process
That was actually delightfully simple. WPMU keeps all of the blogs separated into their own tables, so to edit all the posts for a certain blog you just replace “wp_posts” with “wp_N_posts” where N is the BLOG_ID of the blog you want to fix up.
Thanks for the recipe!
Thank you so much! I’m designing a site that’s importing from Blogger, but unfortunately I was labeled as the author of all the posts instead of the blog owner. This was a quick fix (there were over 900 posts!).
Thanks so much for this…exactly what I was looking for!
Andy
Trackbacks: