Change the Author of Multiple WordPress Posts

Disclaimer: This idea requires access to the shell on your webserver.

This is the SQL query you’ll use:

UPDATE wp_posts 
SET post_author='[NEW ID]' 
WHERE post_author='[EXISTING ID]';

I had posts that were assigned to Admin (which by default is user ID 1), and I wanted to assign them all to my user (which in this case is user ID 2).

My query looked like this:

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

That will go through the posts database and update the author for all of them.


Back Again

Sometimes I wonder how the content for this blog still exists…  I started this blog more than 3 years ago using Drupal, and since then I’ve converted the SQL to be used with wordpress, and had numerous problems that could have caused me to lose everything.  Somehow I still have it, and I’m happy that I do.

I have to say that this version of wordpress is so much better than the version I was using before (which was 2.1)

Anyways, look back for some new posts coming.