sqlwordpress

How to Move Comments from One Post/Page to Another in WordPress?

Sometimes, for SEO purposes, you would like to move a few comments from one post/page to another in WordPress. This is not built in by WordPress, however there is a workaround.

How to Move WordPress Comments via SQL?

In WordPress Comments page, you know the ID of the comments and the post_id or page_id, so you can login to PHPMyAdmin or simply the MySQL console and issue the following command to move one particular comment (given comment ID) to a specific post/page.

update `wp_comments` set `comment_post_ID` = {TARGET_ID} where `comment_ID` = {COMMENT_ID};

You can move several comments at a time, by using the SQL in statement.

update `wp_comments` set `comment_post_ID` = {TARGET_ID} where `comment_ID` in ({COMMENT_ID}, {COMMENT_ID}, {COMMENT_ID} ...);

You might also consider wrapping the SQL via PHP Script, which gives you more flexibility.

How to Move WordPress Comments via Plugin?

Writing SQL or PHP isn’t easy or convinient for everyone, so here is a WordPress Plugin that does the job.

Upon activation, you then can go to the WordPress comments page, select the comments you want to move.

and, apply ‘Move Comments’ options, you then need to select the target post/page (destination) for these comments to go to (the post_titles are listed and you can search the titles). Click the ‘Update’ and you will have all the selected comments moved. How easy is that!

–EOF (The Ultimate Computing & Technology Blog) —