WordPress: Change Author ID / Attribution On All Posts In a Single Pass

www.lau‮.irutt‬com
WordPress: Change Author ID / Attribution On All Posts In a Single Pass

To change the author ID (or attribution) on all posts in WordPress, you can use the following MySQL statement:

UPDATE wp_posts SET post_author = 'new_author_id' WHERE post_type = 'post';

This statement will update the post_author field for all posts with a post_type of 'post' and set it to the value specified in 'new_author_id'.

Before running this statement, make sure to replace "wp_" with the correct prefix for your WordPress database tables. The default prefix is "wp_", but it can be different if you have changed it during the WordPress installation process.

It is also a good idea to back up your database before running any update statements, in case you need to restore the data later.

Here is an example of how you can run this statement using the MySQL command-line client:

mysql> USE database_name;
mysql> UPDATE wp_posts SET post_author = 'new_author_id' WHERE post_type = 'post';

Replace "database_name" with the name of your WordPress database and "new_author_id" with the ID of the user you want to set as the author for all posts.

You can also run this statement using a tool like phpMyAdmin or by using a WordPress plugin that allows you to run custom SQL queries.

Created Time:2017-10-30 14:27:34  Author:lautturi