I ran into an annoying problem with WordPress recently. The problem was with the author for each of my posts. I wrote several posts with no troubles; the posts were showing me as the author as expected. However, after adding a new user account to the blog, all my posts started showing up with the new user as the author of my posts. I’m currently running 2.6.1, but I’ve heard others talk about this with previous versions as well. To get around this bug, I would go into the data base and update the post_author field in the wp_posts table. This worked but was frustrating to have to do this for every post.
So, here’s what I did to fix it. While logged into my account, I changed the new user to a role of subscriber then changed them back to the role I wanted them to be. Now when I write my posts the author tag is correct again.
After further investigation, I found that the error may have something to do with the wp_usermeta table. There was a record in this table for the new user with a meta_key of wp_user_level and meta_value of 1. After changing this other user account to subscriber then back again, this record was removed. I’m not sure if other changes were made in the process, but you may be able to solve this by simply deleting that record as well.
I hope that helps anyone else out there frustrated by this issue.
UPDATE (09/23/2008) – I ran into this same problem on a different WordPress installation today. This time, the above solution did not work. The problem was that my admin account was missing the entry in the wp_usermeta table all together. I corrected this by inserting the value for my account with the following SQL:
insert into wp_usermeta VALUES(null, 1, 'wp_user_level', '10')
Where 1 is the id of my account. You can determine the correct id by looking at the wp_users table.