Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

WordPress links each comment to a post through the comment’s comment_post_ID value. To move comments, change that value from the old post’s ID to the destination post’s ID. The safest method depends on your access: a targeted database update is direct but requires a verified backup, while WP-CLI is useful for inventory and validation but its official examples do not document this exact field migration.

Choose the right method

Approach Best for Advantages Risks or limits
Targeted database update Administrators with database access and a recovery plan Can move only comments belonging to a specified source post in one operation Direct SQL bypasses WordPress handlers; table prefixes, IDs, caches and comment counts require manual verification
WP-CLI-assisted workflow Sites managed from the command line wp comment list exposes IDs, post IDs, approval status and parent IDs; WordPress-aware commands help with inspection The official examples reviewed do not verify a guaranteed command for changing comment_post_ID; check the installed version’s help before attempting one

Before moving anything

  • Create a tested, recoverable database backup. A backup that cannot be restored is not a recovery plan.
  • Confirm the numeric ID of the source post and the destination post. In the WordPress editor, the post ID may appear in the URL, or you can inspect it with WP-CLI.
  • Identify the site’s actual database table prefix. The common wp_ prefix is only an example.
  • Decide whether every comment on the source post should move or only a selected set. A blanket update is inappropriate if the source contains comments that must stay.
  • Record the affected comment IDs, approval values in comment_approved, and reply relationships in comment_parent so you can compare them afterward.
  • Schedule the change during a quiet period and temporarily prevent simultaneous comment submissions if an exact before-and-after inventory matters.

Move all comments from one post with SQL

The following pattern changes the association for every comment currently attached to one source post:

UPDATE your_prefix_comments
SET comment_post_ID = NEW_POST_ID
WHERE comment_post_ID = OLD_POST_ID;

Replace your_prefix_comments, NEW_POST_ID, and OLD_POST_ID with verified values. The table name must use your real prefix, and the IDs must be integers belonging to the intended posts. Do not paste the illustrative pattern unchanged.

Preview the rows first

SELECT comment_ID, comment_post_ID, comment_parent, comment_approved
FROM your_prefix_comments
WHERE comment_post_ID = OLD_POST_ID;

Save the returned IDs and count. If the result includes comments that should remain, stop and narrow the WHERE clause to an explicit list or another carefully tested condition.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Run the update

UPDATE your_prefix_comments
SET comment_post_ID = NEW_POST_ID
WHERE comment_post_ID = OLD_POST_ID;

Check the database client’s affected-row count. It should match the number of rows you intended to move. If it does not, do not continue to front-end testing until you understand why.

Limit the operation to selected comments

For a hand-picked set, target comment IDs instead of the source post:

UPDATE your_prefix_comments
SET comment_post_ID = NEW_POST_ID
WHERE comment_ID IN (COMMENT_ID_1, COMMENT_ID_2, COMMENT_ID_3);

Keep the original ID list with your change record. This avoids moving unrelated comments from the source post.

Use WP-CLI to inspect and verify

WP-CLI’s comment commands are useful for building an inventory before and after the change. Start by checking the command and version available on the site:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
wp --info
wp comment list --help

List comments associated with the source post and include the fields needed for comparison:

wp comment list --post_id=OLD_POST_ID --fields=comment_ID,comment_post_ID,comment_parent,comment_approved --format=table

The generic wp comment update command accepts comment IDs and fields, but the official reference examples reviewed do not establish a guaranteed field-specific command for changing the post association. Do not assume a command such as an update of comment_post_ID will work on every installation. Read the local help, test on a staging copy, and verify the resulting rows before using it in production. If the installed command does not support the field, use a controlled database operation rather than an unverified one-liner.

Verify the move in WordPress

  1. Run a database query or wp comment list for the old post. The moved comments should no longer appear there.
  2. Query the destination post and compare the comment IDs with your saved pre-change list.
  3. Open the destination post while logged out or in a private window and confirm the comments render in the expected order.
  4. Inspect replies. Each reply keeps its comment_parent value, so parent comments and their children must now belong to the same destination post for the thread to display correctly.
  5. Check moderation states. Values in comment_approved should be unchanged unless you intentionally altered moderation.
  6. Check the displayed comment count on both posts. A direct SQL update does not prove that WordPress recalculated counters or cleared every cache.
  7. Purge the site’s normal page, object and CDN caches, then repeat the front-end check.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

When counts or threads look wrong

The destination shows stale comments

Clear application and page caches, then reload the post in a private browser session. If the database shows the new post ID but the page does not, investigate the site’s normal cache and comment-query layers rather than editing more rows.

The count is inaccurate

Do not “fix” the count by guessing a number in the database. Compare approved-comment rows with the count shown by WordPress and use the site’s normal WordPress-aware maintenance process to recalculate or repair derived values.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Replies are detached

Verify that every moved reply’s parent comment was moved as well and that each comment_parent points to an existing comment in the same destination thread. Restore the backup if the relationship was altered unintentionally.

The wrong comments moved

Stop further changes and restore the database backup or reverse the update using the recorded original post ID. Do not attempt a second broad update until the affected comment IDs are known.

Plugins and unsupported shortcuts

An older support discussion mentioned a plugin that was later removed because of security issues. Its removal is a reason not to recommend that named plugin as a current solution; it is not evidence that every present-day comment plugin is unsafe. No currently verified, dedicated migration plugin is established here, so prefer a tested backup-and-database or locally verified WP-CLI workflow over installing an unfamiliar tool solely for this task.

After the migration

  • Keep the backup and the before-and-after comment ID lists until the destination has been reviewed.
  • Confirm links, pagination and moderation screens for the destination post.
  • Tell moderators where the discussion now lives and whether any comments were intentionally excluded.
  • Remove temporary maintenance restrictions only after the front-end and administrative checks pass.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.