Changing WordPress Author of Article from Admin user

Its not good practice to list the authors of a wordpress arcticle, especially if they are an admin user of wordpress. This would give a hacker valid username and they can then attempt to guess the password and then have full access to wordpress site.

Should you need to change the name of the Author who wrote an arcticle or ‘post’ in wordpress, here’s the Dbase sql statement to do that:

  • login to mysql database on linux command line as wordpress user mysql -uwpressuser -p  wordpressdb
  • find list of users and there author id’s

select * from wp_users;

  • Then find list of articles and list by author with id 1

select ID,post_author, post_date, post_title from wp_posts where post_author=1;

Finally, to alter the posts author ID to an alternative NON admin user:

update wp_posts SET post_author=5 where ID=238;

If you would like to remove the users name altogether from future posts read this

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.